aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml11
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml b/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
index 1143eaf919..c2325fb5ee 100644
--- a/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
+++ b/tests/auto/qml/qqmlecmascript/data/propertyVarOwnership.5.qml
@@ -5,7 +5,8 @@ Item {
id: testOwnership
property bool test: false
- function runTest() {
+ function createComponent()
+ {
var o;
var c = Qt.createComponent("ComponentWithVarProp.qml");
if (c.status == Component.Ready) {
@@ -15,8 +16,12 @@ Item {
}
o.varprop = true; // causes initialization of varProperties.
SingletonType.QObject.trackObject(o); // stores QObject ptr
- if (SingletonType.QObject.trackedObject() == null) return; // is still valid, should have a valid v8object.
- o = new Date(); // causes object to be gc-able.
+ if (SingletonType.QObject.trackedObject() == null) return false // is still valid, should have a valid v8object.
+ return true;
+ }
+
+ function runTest() {
+ if (!createComponent()) return;
gc(); // collect object's v8object + varProperties, queues deleteLater.
if (SingletonType.QObject.trackedObject() != null) return; // v8object was previously collected.
SingletonType.QObject.setTrackedObjectProperty("varprop"); // deferences varProperties of object.