aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml
diff options
context:
space:
mode:
authorMatthew Vogt <matthew.vogt@nokia.com>2012-07-06 09:53:03 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-09 04:01:19 +0200
commit19c0a31319148d4ac716f7cb3295891b5a3b20d9 (patch)
treeec01ac1d68d4888c58a4f3b4f547a287a4c7491d /tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml
parent49a3883e86b61d8facfeea9c43037d484cb50b92 (diff)
Do not permit excessive recursion in component creation
Limit recursion during component creation to prevent infinite recursion resulting in a crash. Recursion results from invoking createObject() in the Component.onCompleted handler. Task-number: QTBUG-25439 Change-Id: Ica2ba099d82b5747c938501af04e67f7ace8402e Reviewed-by: Michael Brasser <michael.brasser@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml')
-rw-r--r--tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml b/tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml
new file mode 100644
index 0000000000..a10afd3ebe
--- /dev/null
+++ b/tests/auto/qml/qqmlcomponent/data/recursionContinuation.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+
+Item {
+ id: root
+
+ property bool success: false
+
+ Component.onCompleted: {
+ for (var i = 0; i < 10; ++i) {
+ Qt.createComponent("RecursiveComponent.qml").createObject(root)
+ }
+
+ var o = Qt.createComponent("TestComponent.qml").createObject(root)
+ root.success = (o != null)
+ }
+}