Fix tst_qqmlcomponent::onDestructionLookup
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 21 Jun 2013 14:10:43 +0000 (16:10 +0200)
committerLars Knoll <lars.knoll@digia.com>
Fri, 21 Jun 2013 17:55:14 +0000 (19:55 +0200)
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 <lars.knoll@digia.com>
tests/auto/qml/qqmlcomponent/data/onDestructionLookup.qml

index a49a86e..a62d81c 100644 (file)
@@ -18,8 +18,13 @@ Item {
         }
     }
 
+    function createObject()
+    {
+        internalComponent.createObject();
+    }
+
     Component.onCompleted: {
-        internalComponent.createObject()
+        createObject()
         gc()
     }
 }