heifwriter/src/main/java/androidx/heifwriter/EglWindowSurface.java
public void release() {
        if (!Objects.equals(mEGLDisplay, EGL14.EGL_NO_DISPLAY)) {
            EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
            EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
            EGL14.eglReleaseThread();
            EGL14.eglTerminate(mEGLDisplay);
        }

        mSurface.release();

        mEGLDisplay = EGL14.EGL_NO_DISPLAY;
        mEGLContext = EGL14.EGL_NO_CONTEXT;
        mEGLSurface = EGL14.EGL_NO_SURFACE;

        mSurface = null;
    }
/**
     * Discard all resources held by this class, notably the EGL context. Also releases the
     * Surface that was passed to our constructor.
     */
Discard all resources held by this class, notably the EGL context. Also releases the
Surface that was passed to our constructor.
Discard all resources held by this class notably the EGL context . Also releases the Surface that was passed to our constructor .
public void release() {
        if (!Objects.equals(mEGLDisplay, EGL14.EGL_NO_DISPLAY)) {
            EGL14.eglDestroySurface(mEGLDisplay, mEGLSurface);
            EGL14.eglDestroyContext(mEGLDisplay, mEGLContext);
            EGL14.eglReleaseThread();
            EGL14.eglTerminate(mEGLDisplay);
        }
        mSurface.release();
        mEGLDisplay = EGL14.EGL_NO_DISPLAY;
        mEGLContext = EGL14.EGL_NO_CONTEXT;
        mEGLSurface = EGL14.EGL_NO_SURFACE;
        mSurface = null;
    }
public void release ( ) { if ( ! Objects . equals ( mEGLDisplay , EGL14 . EGL_NO_DISPLAY ) ) { EGL14 . eglDestroySurface ( mEGLDisplay , mEGLSurface ) ; EGL14 . eglDestroyContext ( mEGLDisplay , mEGLContext ) ; EGL14 . eglReleaseThread ( ) ; EGL14 . eglTerminate ( mEGLDisplay ) ; } mSurface . release ( ) ; mEGLDisplay = EGL14 . EGL_NO_DISPLAY ; mEGLContext = EGL14 . EGL_NO_CONTEXT ; mEGLSurface = EGL14 . EGL_NO_SURFACE ; mSurface = null ; }
Discard all resources held by this class, notably the EGL context.
Discard all resources held by this class notably the EGL context .