Don't crash if calling a method on a QObject that has been gc()'d
authorAaron Kennedy <aaron.kennedy@nokia.com>
Tue, 3 Apr 2012 11:37:29 +0000 (12:37 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Apr 2012 14:22:04 +0000 (16:22 +0200)
commit7aa4c4164e0b7e09bfb0ea50d7f70203f7871bc6
tree159697b3f94cb5cf591f46be4535253e9ad62ea3
parent411066bdf2d09a8f0071eb9d494287a6a95639fb
Don't crash if calling a method on a QObject that has been gc()'d

As we don't actually delete an object immediately when it is collected,
it is possible to get into a situation where a method is called on an
object after the collector has marked it to be destroyed.  This fixes
a crash in this case.

Change-Id: I131d4c5d7ed788a91aa52f6af2e5c089d9bf5e08
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
src/qml/qml/qqmldata_p.h
src/qml/qml/v8/qv8qobjectwrapper.cpp
tests/auto/qml/qqmlecmascript/data/deleteLaterObjectMethodCall.qml [new file with mode: 0644]
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp