diff options
author | Matthew Vogt <matthew.vogt@nokia.com> | 2012-04-27 16:12:09 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-04 03:41:33 +0200 |
commit | c31026c9ca7ff0c745dba577f9ac2c14d1ef68c5 (patch) | |
tree | dd3150dd95af2fa9759852d61d9c87b86322852a /src/qml/qml/v8/qv8qobjectwrapper.cpp | |
parent | 6318560eca7e3247a63620ce24d2d7e291dd5d84 (diff) |
Emit Component.onDestruction before context is invalidated
When a component no longer has any live references, emit the
destruction signal immediately so that handlers are run before the
associated V8 resources are invalidated. Also, when the root
context of the engine is destroyed, emit the destruction signal
before destroying any resources needed to process the resulting
binding invocations.
Change-Id: I722dd6e4b60c499b533fc45e33b61e95bca6187f
Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'src/qml/qml/v8/qv8qobjectwrapper.cpp')
-rw-r--r-- | src/qml/qml/v8/qv8qobjectwrapper.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/qml/v8/qv8qobjectwrapper.cpp b/src/qml/qml/v8/qv8qobjectwrapper.cpp index f2acac5bbc..7e7b6eb570 100644 --- a/src/qml/qml/v8/qv8qobjectwrapper.cpp +++ b/src/qml/qml/v8/qv8qobjectwrapper.cpp @@ -1160,6 +1160,9 @@ void QV8QObjectWrapper::deleteWeakQObject(QV8QObjectResource *resource) ddata->v8object.Clear(); if (!object->parent() && !ddata->indestructible) { + // This object is notionally destroyed now + if (ddata->ownContext && ddata->context) + ddata->context->emitDestruction(); ddata->isQueuedForDeletion = true; object->deleteLater(); } |