aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml
diff options
context:
space:
mode:
authorChris Adams <christopher.adams@nokia.com>2012-03-14 12:00:40 +1000
committerQt by Nokia <qt-info@nokia.com>2012-05-30 04:37:59 +0200
commit47eb68ab0b8d9ffd357cbad2f74b63ee2cf00dad (patch)
tree5159737869c7b8981003ed519b8cd8541799728e /tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml
parent7f8c243dec987018db47547c6ddea9cd8272e02a (diff)
Ensure that variant property references keep QObjects alive
Previously, only var property references could keep QObjects alive. This meant that the garbage collector would collect QObject data prematurely. This commit ensures that variant properties keep QObjects alive as required. Task-number: QTBUG-24767 Change-Id: Ic98a06863251a3e7d6384ba9256810a78fb23406 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml')
-rw-r--r--tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml b/tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml
new file mode 100644
index 0000000000..897fd990ec
--- /dev/null
+++ b/tests/auto/qml/qqmlecmascript/data/HRMDPComponent.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import Qt.test.qobjectApi 1.0 as QObjectApi
+
+Item {
+ property int variantCanary: 5
+ property var varCanary: 12
+
+ Component.onCompleted: {
+ QObjectApi.qobjectTestWritableProperty = 42;
+ }
+
+ Component.onDestruction: {
+ QObjectApi.qobjectTestWritableProperty = 43;
+ }
+}