diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2013-09-17 15:05:04 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-06-30 10:32:57 +0200 |
commit | 0ca2b46893f73ec1dff9440cd462f9c64b989335 (patch) | |
tree | c21b8ef652702d1dda9af3780ebd088379b09914 /tests/auto/quick/qquickwindow/data | |
parent | 5da2576633bc0d0150a8607a30ab1f66f040bb19 (diff) |
Avoid double deletion of QQuickWindow
It's uncertain why 4fc0df58b8458052a818e3e970a97457882808e6 added
the call to sendPostedEvents(0, QEvent::DeferredDelete) but now we can
see that it easily results in the destructor calling itself, and
therefore double-deleting its own d_ptr. removePostedEvents seems
safer to ensure that the window cannot be doubly deleted, in spite
of the qdoc warning that "You should never need to call this function."
Task-number: QTBUG-33436
Change-Id: I4873ebe179dde551407eba1f6baac5f03ca7f177
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
Diffstat (limited to 'tests/auto/quick/qquickwindow/data')
-rw-r--r-- | tests/auto/quick/qquickwindow/data/unloadSubWindow.qml | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickwindow/data/unloadSubWindow.qml b/tests/auto/quick/qquickwindow/data/unloadSubWindow.qml new file mode 100644 index 0000000000..bf9df4867d --- /dev/null +++ b/tests/auto/quick/qquickwindow/data/unloadSubWindow.qml @@ -0,0 +1,22 @@ +import QtQuick 2.3 +import QtQuick.Window 2.2 + +Window { + id: root + property var transientWindow + property Loader loader1: Loader { + sourceComponent: Item { + Loader { + id: loader2 + sourceComponent : Window { + id: inner + visible: true + Component.onCompleted: root.transientWindow = inner + } + } + Component.onDestruction: { + loader2.active = false; + } + } + } +} |