From 46595f3a20e9d1d8483172bdd27d17652c4d302e Mon Sep 17 00:00:00 2001 From: Aaron Kennedy Date: Wed, 10 Feb 2010 16:26:30 +1000 Subject: Test --- .../declarative/qmlecmascript/tst_qmlecmascript.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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" -- cgit v0.12