summaryrefslogtreecommitdiffstats
path: root/tests/qmlmultiwindow/qml/qmlmultiwindow
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2014-10-14 14:35:03 +0300
committerMiikka Heikkinen <miikka.heikkinen@theqtcompany.com>2014-10-15 09:37:17 +0300
commit91a9698b80bcb072a5ec3af69515249bac96aff5 (patch)
treedc2ffcce10e20c499addd739314ae1bda661eaba /tests/qmlmultiwindow/qml/qmlmultiwindow
parentd0244a84f150fe59327afa9bd59d0f9cdde72406 (diff)
Simplify context handling at cleanup.
If the context exists at renderer deletion, it is possible that it no longer has valid surface, which means it won't be possible to set it back to current if we change context for deletion cleanup. Since the current context will be one of our shared contexts anyway, there is no need to do a dummy context for cleanup unless the current context is null. Change-Id: Ibabe081742beb975ee848ccb3690703ef5b027a9 Reviewed-by: Mika Salmela <mika.salmela@digia.com> Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests/qmlmultiwindow/qml/qmlmultiwindow')
-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)
}
}