summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/script/api/qscriptengine.cpp8
-rw-r--r--src/script/api/qscriptengine_p.h1
-rw-r--r--src/script/bridge/qscriptqobject.cpp1
3 files changed, 8 insertions, 2 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp
index c69f1ee..c88f464 100644
--- a/src/script/api/qscriptengine.cpp
+++ b/src/script/api/qscriptengine.cpp
@@ -811,8 +811,8 @@ QScriptEnginePrivate::QScriptEnginePrivate() : idGenerator(1)
JSC::initializeThreading(); // ### hmmm
- JSC::JSGlobalData *data = JSC::JSGlobalData::create().releaseRef();
- globalObject = new (data)QScript::GlobalObject(this);
+ globalData = JSC::JSGlobalData::create().releaseRef();
+ globalObject = new (globalData)QScript::GlobalObject(this);
JSC::ExecState* exec = globalObject->globalExec();
@@ -847,6 +847,10 @@ QScriptEnginePrivate::~QScriptEnginePrivate()
detachAllRegisteredScriptValues();
qDeleteAll(m_qobjectData);
qDeleteAll(m_typeInfos);
+ qDeleteAll(contextForFrameHash);
+ JSC::JSLock lock(false);
+ globalData->heap.destroy();
+ globalData->deref();
}
QScriptValue QScriptEnginePrivate::scriptValueFromJSCValue(JSC::JSValue value)
diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h
index 29581e4..1626428 100644
--- a/src/script/api/qscriptengine_p.h
+++ b/src/script/api/qscriptengine_p.h
@@ -156,6 +156,7 @@ public:
void _q_objectDestroyed(QObject *);
#endif
+ JSC::JSGlobalData *globalData;
JSC::JSGlobalObject *globalObject;
JSC::JSObject *customGlobalObject;
JSC::ExecState *currentFrame;
diff --git a/src/script/bridge/qscriptqobject.cpp b/src/script/bridge/qscriptqobject.cpp
index 4a7cd1e..85e255c 100644
--- a/src/script/bridge/qscriptqobject.cpp
+++ b/src/script/bridge/qscriptqobject.cpp
@@ -1582,6 +1582,7 @@ QMetaObjectWrapperObject::QMetaObjectWrapperObject(
QMetaObjectWrapperObject::~QMetaObjectWrapperObject()
{
+ delete data;
}
bool QMetaObjectWrapperObject::getOwnPropertySlot(