Emit destruction signal before child contexts are destroyed.
authorGlenn Watson <glenn.watson@nokia.com>
Mon, 21 Nov 2011 22:02:17 +0000 (08:02 +1000)
committerQt by Nokia <qt-info@nokia.com>
Tue, 22 Nov 2011 02:31:14 +0000 (03:31 +0100)
commitd2c1adc6f9afc4dd1bab3c487bbde70f3b8f2e81
tree633ef62d68173c588de1ff81e6e6ee25117f0b7f
parent0bf08af2b945f10f44561ffa0abd6f89b093b376
Emit destruction signal before child contexts are destroyed.

Verbatim comment from bug report:

When using a QtObject inside an item, and then we call a function
in the Component.onDestruction handler of that item, we get a
crash. This happens because the QDeclarativeContextData engine
has been invalidated before reaching
QDeclarativeExpressionPrivate::evalFunction.

Change code to emit the onDestruction signal before the child
contexts are invalidated.

Task-number: QTBUG-22535
Change-Id: Ic4983ae5fdf104ae977189c21dc202c9b02bc2bc
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
src/declarative/qml/qdeclarativecontext.cpp
tests/auto/declarative/qdeclarativecontext/data/Object_22535.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativecontext/data/qtbug_22535.qml [new file with mode: 0644]
tests/auto/declarative/qdeclarativecontext/tst_qdeclarativecontext.cpp