summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs/api
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2019-04-15 15:50:15 +0200
committerUlf Hermann <ulf.hermann@qt.io>2019-04-16 08:00:14 +0000
commit7c6b969383a403474a63715fd7a12caddd826611 (patch)
tree508ef5136e3bfc08d91ad0589453b2aab5f0608e /src/plugins/platforms/eglfs/api
parent5b3dfa470ed7ea40103daa785286ab71fb7aa230 (diff)
eglfs: Call destroy() from dtors of concrete windows
Calling destroy from the QEglFSWindow dtor() triggers the virtual invalidateSurface() to be called on a partly destroyed object. As the child windows deregister themselves from their screens on invalidateSurface() this is dangerous: It leaves a dangling pointer in the screen. Fixes: QTBUG-75075 Change-Id: Idd3fea18562d41973f364340df875a50dbd5691e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs/api')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 98e9ee4728..c1d5af47aa 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -167,6 +167,9 @@ void QEglFSWindow::create()
void QEglFSWindow::destroy()
{
+ if (!m_flags.testFlag(Created))
+ return; // already destroyed
+
#ifndef QT_NO_OPENGL
QOpenGLCompositor::instance()->removeWindow(this);
#endif