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 e4f9ff5d91
commit 6c733702de

View file

@ -135,6 +135,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);
}