Fully clean up resources in EGLSurfaceTexture

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=201376315
This commit is contained in:
andrewlewis 2018-06-20 10:38:00 -07:00 committed by Oliver Woodman
parent 6bdd184eab
commit 8ab8b86a7b

View File

@ -145,6 +145,10 @@ public final class EGLSurfaceTexture implements SurfaceTexture.OnFrameAvailableL
if (context != null) { if (context != null) {
EGL14.eglDestroyContext(display, context); EGL14.eglDestroyContext(display, context);
} }
// EGL14.eglReleaseThread could crash before Android K (see [internal: b/11327779]).
if (Util.SDK_INT >= 19) {
EGL14.eglReleaseThread();
}
display = null; display = null;
context = null; context = null;
surface = null; surface = null;