diff --git a/CHANGES b/CHANGES index 020f84b08..219312b86 100644 --- a/CHANGES +++ b/CHANGES @@ -17,6 +17,7 @@ Other fixes: - Qt: Force OpenGL paint engine creation thread (fixes mgba.io/i/1642) - Qt: Fix color selection in asset view (fixes mgba.io/i/1648) - Qt: Fix missing OSD messages + - Qt: Fix crash unloading shaders 0.8.0: (2020-01-21) Features: diff --git a/src/platform/qt/DisplayGL.cpp b/src/platform/qt/DisplayGL.cpp index c14f4e674..e9af27952 100644 --- a/src/platform/qt/DisplayGL.cpp +++ b/src/platform/qt/DisplayGL.cpp @@ -575,10 +575,19 @@ void PainterGL::clearShaders() { return; } #ifdef BUILD_GLES2 + if (!m_started) { + m_gl->makeCurrent(m_surface); +#if defined(_WIN32) && defined(USE_EPOXY) + epoxy_handle_external_wglMakeCurrent(); +#endif + } if (m_shader.passes) { mGLES2ShaderDetach(reinterpret_cast(m_backend)); mGLES2ShaderFree(&m_shader); } + if (!m_started) { + m_gl->doneCurrent(); + } #endif }