diff options
author | Peter Kümmel <syntheticpp@gmx.net> | 2012-09-20 08:50:23 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-09-25 21:11:21 (GMT) |
commit | 770ef3867e7b7d8591f6a75783ee9ed1ce2da2d4 (patch) | |
tree | 6d73b5e67169041c9950b806a98f12dd94c65748 /src/script | |
parent | 872d6aff3ea96d548e0bad99def669b803368a36 (diff) | |
download | Qt-770ef3867e7b7d8591f6a75783ee9ed1ce2da2d4.zip Qt-770ef3867e7b7d8591f6a75783ee9ed1ce2da2d4.tar.gz Qt-770ef3867e7b7d8591f6a75783ee9ed1ce2da2d4.tar.bz2 |
Revert "Delete JS-owned QML objects right away in the engine dtor."
This reverts commit ecc432a5b7ae269220f86c6f0b3dd364f8643191
to fix a crash on exit.
Task-number: QTBUG-20377
Change-Id: I6606ff194f2c16e06bdbbfca94e55821cf055f75
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thomas McGuire <thomas.mcguire@kdab.com>
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/api/qscriptengine.cpp | 3 | ||||
-rw-r--r-- | src/script/api/qscriptengine_p.h | 1 | ||||
-rw-r--r-- | src/script/bridge/qscriptdeclarativeclass_p.h | 9 | ||||
-rw-r--r-- | src/script/bridge/qscriptdeclarativeobject.cpp | 5 |
4 files changed, 2 insertions, 16 deletions
diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index cebbe0e..d821084 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -962,7 +962,7 @@ QScriptEnginePrivate::QScriptEnginePrivate() qobjectPrototype(0), qmetaobjectPrototype(0), variantPrototype(0), activeAgent(0), agentLineNumber(-1), registeredScriptValues(0), freeScriptValues(0), freeScriptValuesCount(0), - registeredScriptStrings(0), processEventsInterval(-1), inEval(false), inDestructor(false) + registeredScriptStrings(0), processEventsInterval(-1), inEval(false) { qMetaTypeId<QScriptValue>(); qMetaTypeId<QList<int> >(); @@ -1015,7 +1015,6 @@ QScriptEnginePrivate::QScriptEnginePrivate() QScriptEnginePrivate::~QScriptEnginePrivate() { - inDestructor = true; QScript::APIShim shim(this); //disconnect all loadedScripts and generate all jsc::debugger::scriptUnload events diff --git a/src/script/api/qscriptengine_p.h b/src/script/api/qscriptengine_p.h index 8a7037b..6a023d7 100644 --- a/src/script/api/qscriptengine_p.h +++ b/src/script/api/qscriptengine_p.h @@ -382,7 +382,6 @@ public: int processEventsInterval; QScriptValue abortResult; bool inEval; - bool inDestructor; JSC::UString cachedTranslationUrl; JSC::UString cachedTranslationContext; diff --git a/src/script/bridge/qscriptdeclarativeclass_p.h b/src/script/bridge/qscriptdeclarativeclass_p.h index c67d23d..c8c35bf 100644 --- a/src/script/bridge/qscriptdeclarativeclass_p.h +++ b/src/script/bridge/qscriptdeclarativeclass_p.h @@ -77,14 +77,7 @@ public: typedef void* Identifier; - struct Object { - // Like the destructor, frees resources associated with this object. The difference is that - // the destructor might delay resource freeing with deleteLater(), while disposeNow() always - // deletes the resource straigt away. - virtual void disposeNow() {} - - virtual ~Object() {} - }; + struct Object { virtual ~Object() {} }; static QScriptValue newObject(QScriptEngine *, QScriptDeclarativeClass *, Object *); static Value newObjectValue(QScriptEngine *, QScriptDeclarativeClass *, Object *); diff --git a/src/script/bridge/qscriptdeclarativeobject.cpp b/src/script/bridge/qscriptdeclarativeobject.cpp index a9cd87d..927309a 100644 --- a/src/script/bridge/qscriptdeclarativeobject.cpp +++ b/src/script/bridge/qscriptdeclarativeobject.cpp @@ -53,11 +53,6 @@ DeclarativeObjectDelegate::DeclarativeObjectDelegate(QScriptDeclarativeClass *c, DeclarativeObjectDelegate::~DeclarativeObjectDelegate() { - // When the engine is being destructed, delete the object now, instead of using deleteLater(), - // to not have memory leaks on exit. - if (m_class->engine() && QScriptEnginePrivate::get(m_class->engine())->inDestructor) - m_object->disposeNow(); - delete m_object; } |