Make no context current when releasing DummySurface

This avoids a small native leak.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=200955086
This commit is contained in:
andrewlewis 2018-06-18 01:36:06 -07:00 committed by Oliver Woodman
parent 3570232cf0
commit 1776e6e5b0

View File

@ -111,6 +111,10 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
GLES20.glDeleteTextures(1, textureIdHolder, 0);
}
} finally {
if (display != null && !display.equals(EGL14.EGL_NO_DISPLAY)) {
EGL14.eglMakeCurrent(
display, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_SURFACE, EGL14.EGL_NO_CONTEXT);
}
if (surface != null && !surface.equals(EGL14.EGL_NO_SURFACE)) {
EGL14.eglDestroySurface(display, surface);
}