From 85f1cd7356c52c2a8855faa0ab201f69f37ec4e9 Mon Sep 17 00:00:00 2001 From: kaisa695275735 <37927189+kaisa695275735@users.noreply.github.com> Date: Tue, 15 Sep 2020 05:07:39 +0800 Subject: [PATCH] delete opengl texture when it detatch from surfacetexture. (flutter/engine#18733) --- .../shell/platform/android/android_external_texture_gl.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc b/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc index ae5101012f7..ac4f73eca7c 100644 --- a/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc +++ b/engine/src/flutter/shell/platform/android/android_external_texture_gl.cc @@ -82,6 +82,7 @@ void AndroidExternalTextureGL::UpdateTransform() { void AndroidExternalTextureGL::OnGrContextDestroyed() { if (state_ == AttachmentState::attached) { Detach(); + glDeleteTextures(1, &texture_name_); } state_ = AttachmentState::detached; }