From f3254b3a6059c84edf7ad7d2405876248686de31 Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Thu, 17 Jun 2021 08:59:01 -0700 Subject: [PATCH] Fix a leak of the resource EGL context on Android (flutter/engine#26789) --- .../src/flutter/shell/platform/android/android_surface_gl.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/android/android_surface_gl.cc b/engine/src/flutter/shell/platform/android/android_surface_gl.cc index 1178434514..f8a933dede 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_gl.cc @@ -92,7 +92,9 @@ bool AndroidSurfaceGL::ResourceContextMakeCurrent() { bool AndroidSurfaceGL::ResourceContextClearCurrent() { FML_DCHECK(IsValid()); - return GLContextPtr()->ClearCurrent(); + EGLBoolean result = eglMakeCurrent(eglGetCurrentDisplay(), EGL_NO_SURFACE, + EGL_NO_SURFACE, EGL_NO_CONTEXT); + return result == EGL_TRUE; } bool AndroidSurfaceGL::SetNativeWindow(