aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlincubator/data/garbageCollection.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlincubator/data/garbageCollection.qml')
-rw-r--r--tests/auto/qml/qqmlincubator/data/garbageCollection.qml19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlincubator/data/garbageCollection.qml b/tests/auto/qml/qqmlincubator/data/garbageCollection.qml
new file mode 100644
index 0000000000..6866a02a00
--- /dev/null
+++ b/tests/auto/qml/qqmlincubator/data/garbageCollection.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+
+QtObject {
+ id: root
+
+ property var incubator
+
+ function getAndClearIncubator() {
+ var result = incubator
+ incubator = null
+ return result
+ }
+
+ Component.onCompleted: {
+ var c = Qt.createComponent("statusChanged.qml"); // use existing simple type for convenience
+ var incubator = c.incubateObject(root);
+ incubator.onStatusChanged = function(status) { if (status === 1) root.incubator = incubator }
+ }
+}