diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-26 01:36:00 (GMT) |
---|---|---|
committer | Aaron Kennedy <aaron.kennedy@nokia.com> | 2009-10-26 01:36:00 (GMT) |
commit | 2b0cf3b6a2f1c49f40d6f50b4d24bdd87a4807fa (patch) | |
tree | 5054d537a64aedb53761ae5c8f3ee8b8dda1aa1a /src/declarative/qml/qmlengine.cpp | |
parent | cbb1b29d397c063fc3bcae04c5b062f20cbd12c5 (diff) | |
download | Qt-2b0cf3b6a2f1c49f40d6f50b4d24bdd87a4807fa.zip Qt-2b0cf3b6a2f1c49f40d6f50b4d24bdd87a4807fa.tar.gz Qt-2b0cf3b6a2f1c49f40d6f50b4d24bdd87a4807fa.tar.bz2 |
Ensure cleanup happens before the destruction of QScriptEngine
This was causing crashes on windows.
Diffstat (limited to 'src/declarative/qml/qmlengine.cpp')
-rw-r--r-- | src/declarative/qml/qmlengine.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 354114a..4f3b2ba 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -128,7 +128,7 @@ static QString userLocalDataPath(const QString& app) QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) : rootContext(0), currentExpression(0), isDebugging(false), contextClass(0), objectClass(0), valueTypeClass(0), globalClass(0), - nodeListClass(0), namedNodeMapClass(0), sqlQueryClass(0), scriptEngine(this), + nodeListClass(0), namedNodeMapClass(0), sqlQueryClass(0), cleanup(0), scriptEngine(this), componentAttacheds(0), rootComponent(0), networkAccessManager(0), typeManager(e), uniqueId(1) { QScriptValue qtObject = @@ -168,6 +168,15 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e) QmlEnginePrivate::~QmlEnginePrivate() { + while (cleanup) { + QmlCleanup *c = cleanup; + cleanup = c->next; + if (cleanup) cleanup->prev = &cleanup; + c->next = 0; + c->prev = 0; + c->clear(); + } + delete rootContext; rootContext = 0; delete contextClass; |