aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickloader/data
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2013-12-05 16:21:03 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-06 15:18:47 +0100
commitadaedcb9ead1c536ff3d8fba0fb9f4fc262d4d45 (patch)
tree7d798f62b3ad61a038468e4e418899388966f968 /tests/auto/quick/qquickloader/data
parent433949df18625e5a04d8e83908ee51f703380f21 (diff)
Fix crash in QQuickLoader when source component is garbage collected
It may happen that the QQuickLoader is the last entity left in the system holding a reference to the QQmlComponent *sourceComponent. We have to let the garbage collector know about that by keeping a persistent value for it. Task-number: QTBUG-35334 Change-Id: I715864440378fd9dd4f2d5ef8ff2f171c81ed7ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Diffstat (limited to 'tests/auto/quick/qquickloader/data')
-rw-r--r--tests/auto/quick/qquickloader/data/SimpleTestComponent.qml2
-rw-r--r--tests/auto/quick/qquickloader/data/sourceComponentGarbageCollection.qml8
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickloader/data/SimpleTestComponent.qml b/tests/auto/quick/qquickloader/data/SimpleTestComponent.qml
new file mode 100644
index 0000000000..0e69012662
--- /dev/null
+++ b/tests/auto/quick/qquickloader/data/SimpleTestComponent.qml
@@ -0,0 +1,2 @@
+import QtQml 2.0
+QtObject {}
diff --git a/tests/auto/quick/qquickloader/data/sourceComponentGarbageCollection.qml b/tests/auto/quick/qquickloader/data/sourceComponentGarbageCollection.qml
new file mode 100644
index 0000000000..ab86883af5
--- /dev/null
+++ b/tests/auto/quick/qquickloader/data/sourceComponentGarbageCollection.qml
@@ -0,0 +1,8 @@
+import QtQuick 2.0
+
+Loader {
+ active: false
+ function setSourceComponent() {
+ sourceComponent = Qt.createComponent("SimpleTestComponent.qml");
+ }
+}