public void release ( ) { if ( mEGLDisplay != EGL14 . EGL_NO_DISPLAY ) { // Android is unusual in that it uses a reference-counted EGLDisplay. So for // every eglInitialize() we need an eglTerminate(). EGL14 . eglMakeCurrent ( mEGLDisplay , EGL14 . EGL_NO_SURFACE , EGL14 . EGL_NO_SURFACE , EGL14 . EGL_NO_CONTEXT ) ; EGL14 . eglDestroyContext ( mEGLDisplay , mEGLContext ) ; EGL14 . eglReleaseThread ( ) ; EGL14 . eglTerminate ( mEGLDisplay ) ; } mEGLDisplay = EGL14 . EGL_NO_DISPLAY ; mEGLContext = EGL14 . EGL_NO_CONTEXT ; mEGLConfig = null ; }
Discard all resources held by this class notably the EGL context .