summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-03-02 09:04:38 +0100
committerLiang Qi <liang.qi@qt.io>2017-03-02 09:04:38 +0100
commit71264bae08d81bdeceb96133fdb01c370504dfcc (patch)
treed5dadaac8209d5ef1857a4d65197b9ee12b39848 /src/gui/kernel/qwindow.cpp
parent5e785c0b83c9908c665f253c131629ac325a21f5 (diff)
parent6d10f739cd750968d0dd0e9d8fa4b64353a86c6c (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 8e98958949..c94ea0922a 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -1814,6 +1814,15 @@ void QWindowPrivate::destroy()
q->setVisible(false);
+ // Let subclasses act, typically by doing graphics resource cleaup, when
+ // the window, to which graphics resource may be tied, is going away.
+ //
+ // NB! This is disfunctional when destroy() is invoked from the dtor since
+ // a reimplemented event() will not get called in the subclasses at that
+ // stage. However, the typical QWindow cleanup involves either close() or
+ // going through QWindowContainer, both of which will do an explicit, early
+ // destroy(), which is good here.
+
QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceAboutToBeDestroyed);
QGuiApplication::sendEvent(q, &e);