From 220afb358f6056a6fc091b48a38878fb98aba979 Mon Sep 17 00:00:00 2001 From: Jacek Poplawski Date: Mon, 4 Dec 2023 08:33:51 +0100 Subject: 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 --- src/plugins/platforms/eglfs/api/qeglfswindow.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src') 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 = { }; } -- cgit v1.2.3