diff options
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml')
-rw-r--r-- | tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml b/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml new file mode 100644 index 0000000000..2ddb9253eb --- /dev/null +++ b/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.2.qml @@ -0,0 +1,28 @@ +import QtQuick 2.0 +import Qt.test 1.0 + +Item { + id: obj + objectName: "obj" + + property CircularReferenceObject first + property CircularReferenceObject second + + + CircularReferenceObject { + id: cro + objectName: "cro" + } + + function circularReference() { + // generate the circularly referential pair - they should still be collected + first = cro.generate(); // no parent, so should be collected + second = cro.generate(); // no parent, so should be collected + first.addReference(second); + second.addReference(first); + + // remove top level references + first = cro; + second = cro; + } +} |