aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/controls/data/tst_stackview.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/controls/data/tst_stackview.qml')
-rw-r--r--tests/auto/controls/data/tst_stackview.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_stackview.qml b/tests/auto/controls/data/tst_stackview.qml
index 3c0f0273..3827354b 100644
--- a/tests/auto/controls/data/tst_stackview.qml
+++ b/tests/auto/controls/data/tst_stackview.qml
@@ -1230,4 +1230,19 @@ TestCase {
touch.release(0, control).commit()
verify(!ma.pressed)
}
+
+ // Separate function to ensure that the temporary value created to hold the return value of the Qt.createComponent()
+ // call is out of scope when the caller calls gc().
+ function stackViewFactory()
+ {
+ return createTemporaryObject(stackView, testCase, {initialItem: Qt.createComponent("TestItem.qml")})
+ }
+
+ function test_initalItemOwnership()
+ {
+ var control = stackViewFactory()
+ verify(control)
+ gc()
+ verify(control.initialItem)
+ }
}