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>
This commit is contained in:
parent
5b3dfa470e
commit
7c6b969383
@ -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
|
||||
|
@ -55,6 +55,9 @@ public:
|
||||
: QEglFSWindow(w),
|
||||
m_integration(integration)
|
||||
{ }
|
||||
|
||||
~QEglFSKmsGbmWindow() { destroy(); }
|
||||
|
||||
void resetSurface() override;
|
||||
void invalidateSurface() override;
|
||||
|
||||
|
@ -116,6 +116,8 @@ public:
|
||||
, m_egl_stream(EGL_NO_STREAM_KHR)
|
||||
{ }
|
||||
|
||||
~QEglFSKmsEglDeviceWindow() { destroy(); }
|
||||
|
||||
void invalidateSurface() override;
|
||||
void resetSurface() override;
|
||||
|
||||
|
@ -205,6 +205,9 @@ public:
|
||||
: QEglFSWindow(w)
|
||||
, m_integration(integration)
|
||||
{}
|
||||
|
||||
~QEglFSKmsVsp2Window() { destroy(); }
|
||||
|
||||
void resetSurface() override;
|
||||
void invalidateSurface() override;
|
||||
const QEglFSKmsVsp2Integration *m_integration;
|
||||
|
Loading…
Reference in New Issue
Block a user