From f847e4588fa67e63623c8e824aa53de6e54dcf04 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 21 Jun 2013 16:10:43 +0200 Subject: Fix tst_qqmlcomponent::onDestructionLookup Don't rely on the JIT generated code to immediately discard and ignore the return value of createObject(). Instead move that call into another function that, so that the return value of createObject() is guaranteed to be invisible to the GC and thus collect the recently created object as expected. Change-Id: I08a0a35fc895482792deffbae7f7f6437727d871 Reviewed-by: Lars Knoll --- tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tests/auto/qml/qqmlcomponent') diff --git a/tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml b/tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml index a49a86e1f3..a62d81c844 100644 --- a/tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml +++ b/tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml @@ -18,8 +18,13 @@ Item { } } + function createObject() + { + internalComponent.createObject(); + } + Component.onCompleted: { - internalComponent.createObject() + createObject() gc() } } -- cgit v1.2.3