summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qwindowcontainer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qwindowcontainer.cpp')
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index bb25a3a986..7ae63e54b3 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -241,6 +241,14 @@ QWindow *QWindowContainer::containedWindow() const
QWindowContainer::~QWindowContainer()
{
Q_D(QWindowContainer);
+
+ // Call destroy() explicitly first. The dtor would do this too, but
+ // QEvent::PlatformSurface delivery relies on virtuals. Getting
+ // SurfaceAboutToBeDestroyed can be essential for OpenGL, Vulkan, etc.
+ // QWindow subclasses in particular. Keep these working.
+ if (d->window)
+ d->window->destroy();
+
delete d->window;
}