summaryrefslogtreecommitdiffstats
path: root/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml')
-rw-r--r--tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml b/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml
index 57d62019..da382e3d 100644
--- a/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml
+++ b/tests/qmlmultiwindow/qml/qmlmultiwindow/main.qml
@@ -91,6 +91,13 @@ Rectangle {
}
}
+ function destroyWindow() {
+ if (surfaceWindowObject != null)
+ surfaceWindowObject.destroy()
+ }
+
+ Component.onDestruction: destroyWindow()
+
//! [0]
GridLayout {
id: gridLayout
@@ -114,8 +121,7 @@ Rectangle {
running: false
repeat: false
onTriggered: {
- if (surfaceWindowObject != null)
- surfaceWindowObject.destroy()
+ destroyWindow()
surfaceWindowObject = Qt.createQmlObject(surfaceWindowStr, mainView)
}
}