diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index 166e6cb83d..5d02f7985b 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -320,14 +320,20 @@ static void NO_INLINE zapSomeStack() memset(buf, 0, 4096); } -static void gc(QQmlEngine &engine) +static void gcWithoutDeferredObjectDeletion(QQmlEngine &engine) { zapSomeStack(); engine.collectGarbage(); +} + +static void gc(QQmlEngine &engine) +{ + gcWithoutDeferredObjectDeletion(engine); QCoreApplication::sendPostedEvents(0, QEvent::DeferredDelete); QCoreApplication::processEvents(); } + void tst_qqmlecmascript::initTestCase() { QQmlDataTest::initTestCase(); @@ -4753,6 +4759,8 @@ void tst_qqmlecmascript::propertyVarOwnership() QQmlComponent component(&engine, testFileUrl("propertyVarOwnership.5.qml")); QObject *object = component.create(); QVERIFY(object != 0); + QMetaObject::invokeMethod(object, "createComponent"); + gcWithoutDeferredObjectDeletion(engine); QMetaObject::invokeMethod(object, "runTest"); QCOMPARE(object->property("test").toBool(), true); delete object; |