summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/eglfs
diff options
context:
space:
mode:
authorJacek Poplawski <jacek.poplawski@qt.io>2023-12-04 08:33:51 +0100
committerJacek Poplawski <jacek.poplawski@qt.io>2023-12-04 22:35:45 +0100
commit220afb358f6056a6fc091b48a38878fb98aba979 (patch)
treec9a36684ce1b4db53e87d58e9b04a32326726935 /src/plugins/platforms/eglfs
parentfd1405e61b9939e2630c751367413e07fdc76408 (diff)
Always destroy OpenGL context when the window is destroyed
The OpenGL context was only destroyed when the HasNativeWindow flag was set, as a consequence there was a context leak. Remove this condition and always destroy the context. Change-Id: I3e3424e9d6f179171872fdef5c929a5718af0ed5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/plugins/platforms/eglfs')
-rw-r--r--src/plugins/platforms/eglfs/api/qeglfswindow.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
index 306d121cfb..861dd9c5da 100644
--- a/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
+++ b/src/plugins/platforms/eglfs/api/qeglfswindow.cpp
@@ -152,12 +152,15 @@ void QEglFSWindow::destroy()
#ifndef QT_NO_OPENGL
QOpenGLCompositor::destroy();
- if (qt_gl_global_share_context() == m_rasterCompositingContext)
- qt_gl_set_global_share_context(nullptr);
- delete m_rasterCompositingContext;
#endif
}
+#ifndef QT_NO_OPENGL
+ if (qt_gl_global_share_context() == m_rasterCompositingContext)
+ qt_gl_set_global_share_context(nullptr);
+ delete m_rasterCompositingContext;
+#endif
+
m_flags = { };
}