diff options
author | Liang Qi <liang.qi@qt.io> | 2017-03-02 09:04:38 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-03-02 09:04:38 +0100 |
commit | 71264bae08d81bdeceb96133fdb01c370504dfcc (patch) | |
tree | d5dadaac8209d5ef1857a4d65197b9ee12b39848 /src/gui/kernel/qwindow.cpp | |
parent | 5e785c0b83c9908c665f253c131629ac325a21f5 (diff) | |
parent | 6d10f739cd750968d0dd0e9d8fa4b64353a86c6c (diff) |
Merge remote-tracking branch 'origin/5.9' into dev
Change-Id: I84097f8e7b3b2128028bd7693c913d6968b82bfe
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 9 |
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); |