diff --git a/src/util/opengl_context_egl.cpp b/src/util/opengl_context_egl.cpp index 4ed96428d..372b4e321 100644 --- a/src/util/opengl_context_egl.cpp +++ b/src/util/opengl_context_egl.cpp @@ -292,8 +292,11 @@ void OpenGLContextEGL::DestroySurface(SurfaceHandle handle) return; EGLSurface surface = (EGLSurface)handle; - if (eglGetCurrentSurface(EGL_DRAW) == surface) + if (m_current_surface == surface) + { eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + m_current_surface = EGL_NO_SURFACE; + } DestroyPlatformSurface(surface); }