History

Fix script engine access in XMLHttpRequest

Karol Suprynowicz committed 10 months ago

Commit ff875ce1 parent dcbb1011 file · +7 −0Browse files

Showing the changes to libraries/script-engine/src/XMLHttpRequestClass.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/XMLHttpRequestClass.cpp+7−0
@@ -44,6 +44,13 @@ XMLHttpRequestClass::XMLHttpRequestClass(ScriptEngine* engine) : · 43 unmodified lines
4444
4545 XMLHttpRequestClass::~XMLHttpRequestClass() {
4646 if (_reply) { _reply->deleteLater(); }
47+ Q_ASSERT(_engine);
48+ {
49+ auto guard = _engine->getScopeGuard();
50+ _responseData = ScriptValue();
51+ _onTimeout = ScriptValue();
52+ _onReadyStateChange = ScriptValue();
53+ }
4754 }
4855
4956 ScriptValue XMLHttpRequestClass::constructor(ScriptContext* context, ScriptEngine* engine) {