From 816ef45199d142168b5a40cfb77361cadf00c4a5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Mon, 11 Nov 2024 20:12:18 +1000 Subject: [PATCH] OpenGLDevice: Fix possible missing eglMakeCurrent() after FS --- src/util/opengl_context_egl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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); }