summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
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);