From 45d324a8c6e573b5fe552897122fc679e1da2ecc Mon Sep 17 00:00:00 2001 From: Carter Li Date: Thu, 26 Feb 2026 10:07:05 +0800 Subject: [PATCH] OpenGL: releases EGL context to avoid memleaks --- src/detection/opengl/opengl_shared.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/detection/opengl/opengl_shared.c b/src/detection/opengl/opengl_shared.c index fa70abf74..a3ee920f3 100644 --- a/src/detection/opengl/opengl_shared.c +++ b/src/detection/opengl/opengl_shared.c @@ -98,6 +98,9 @@ static const char* eglHandleSurface(FFOpenGLResult* result, EGLData* data, bool const char* error = eglHandleContext(result, data); FF_DEBUG("eglHandleContext() returns: %s", error ?: "success"); + FF_DEBUG("Releasing current EGL context"); + data->ffeglMakeCurrent(data->display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); + FF_DEBUG("Destroying EGL context"); data->ffeglDestroyContext(data->display, data->context); return error;