diff options
-rw-r--r-- | tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp index 1ba9a52..2182ff4 100644 --- a/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp +++ b/tests/auto/declarative/qmlecmascript/tst_qmlecmascript.cpp @@ -120,6 +120,7 @@ private slots: void undefinedResetsProperty(); void listToVariant(); void multiEngineObject(); + void deletedObject(); void bug1(); @@ -1637,6 +1638,22 @@ void tst_qmlecmascript::multiEngineObject() delete o1; } +// Test that references to QObjects are cleanup when the object is destroyed +void tst_qmlecmascript::deletedObject() +{ + QmlComponent component(&engine, TEST_FILE("deletedObject.qml")); + + QObject *object = component.create(); + + QCOMPARE(object->property("test1").toBool(), true); + QCOMPARE(object->property("test2").toBool(), true); + QCOMPARE(object->property("test3").toBool(), true); + QEXPECT_FAIL("", "QTBUG-8077", Continue); + QCOMPARE(object->property("test4").toBool(), true); + + delete object; +} + QTEST_MAIN(tst_qmlecmascript) #include "tst_qmlecmascript.moc" |