Emit Component.onDestruction before context is invalidated
authorMatthew Vogt <matthew.vogt@nokia.com>
Fri, 27 Apr 2012 06:12:09 +0000 (16:12 +1000)
committerQt by Nokia <qt-info@nokia.com>
Fri, 4 May 2012 01:41:33 +0000 (03:41 +0200)
commitc31026c9ca7ff0c745dba577f9ac2c14d1ef68c5
treedd3150dd95af2fa9759852d61d9c87b86322852a
parent6318560eca7e3247a63620ce24d2d7e291dd5d84
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>
src/qml/qml/qqmlcontext.cpp
src/qml/qml/qqmlcontext_p.h
src/qml/qml/qqmlengine.cpp
src/qml/qml/v8/qv8qobjectwrapper.cpp
tests/auto/qml/qqmlcomponent/data/onDestructionCount.qml [new file with mode: 0644]
tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml [new file with mode: 0644]
tests/auto/qml/qqmlcomponent/tst_qqmlcomponent.cpp
tests/auto/qml/qqmlecmascript/data/OnDestructionComponent.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/data/onDestruction.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/testtypes.h
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp