From b617613bf71f872b4b678cab75080ad4d89043c8 Mon Sep 17 00:00:00 2001 From: Vlad Zagorodniy Date: Mon, 22 Apr 2019 10:34:49 +0300 Subject: [PATCH] [scenes/opengl] Ensure there is current OpenGL context when destroying EffectFrame unstyled texture Summary: BUG: 406671 Reviewers: #kwin, davidedmundson Reviewed By: #kwin, davidedmundson Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D20723 --- plugins/scenes/opengl/scene_opengl.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/plugins/scenes/opengl/scene_opengl.cpp b/plugins/scenes/opengl/scene_opengl.cpp index 8cbe8cc7f3..8da2d358df 100644 --- a/plugins/scenes/opengl/scene_opengl.cpp +++ b/plugins/scenes/opengl/scene_opengl.cpp @@ -369,13 +369,16 @@ SceneOpenGL::~SceneOpenGL() { // do cleanup after initBuffer() gs_debuggedScene = nullptr; - SceneOpenGL::EffectFrame::cleanup(); - if (init_ok) { - delete m_syncManager; - // backend might be still needed for a different scene - delete m_backend; + if (init_ok) { + makeOpenGLContextCurrent(); } + SceneOpenGL::EffectFrame::cleanup(); + + delete m_syncManager; + + // backend might be still needed for a different scene + delete m_backend; } static void scheduleVboReInit()