aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml b/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml
new file mode 100644
index 0000000000..70e8390677
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/handleReferenceManagement.object.1.qml
@@ -0,0 +1,27 @@
+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 createReference() {
+ // generate the objects
+ first = cro.generate(cro); // has parent, so won't be collected
+ second = cro.generate(); // no parent, but will be kept alive by first's reference
+ first.addReference(second);
+
+ // remove top level references
+ first = cro;
+ second = cro;
+ }
+}