From eb4c56aba424096fbc0228ceeb5703df1303bf18 Mon Sep 17 00:00:00 2001 From: Emmanuel Garcia Date: Tue, 25 Aug 2020 12:39:40 -0700 Subject: [PATCH] Fix EGL_BAD_SURFACE when app is paused (flutter/engine#20735) --- .../src/flutter/shell/platform/android/android_surface_gl.cc | 4 ++++ 1 file changed, 4 insertions(+) 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 7f692f00763..b1bd5eec6b9 100644 --- a/engine/src/flutter/shell/platform/android/android_surface_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_surface_gl.cc @@ -35,7 +35,11 @@ AndroidSurfaceGL::AndroidSurfaceGL( AndroidSurfaceGL::~AndroidSurfaceGL() = default; void AndroidSurfaceGL::TeardownOnScreenContext() { + // When the onscreen surface is destroyed, the context and the surface + // instance should be deleted. Issue: + // https://github.com/flutter/flutter/issues/64414 android_context_->ClearCurrent(); + onscreen_surface_ = nullptr; } bool AndroidSurfaceGL::IsValid() const {