Shutdown EGL properly when quitting render loop.

This commit is contained in:
Unknown W. Brackets 2016-02-07 16:30:40 -08:00
parent 4a38a414f7
commit f1afb50fd1
2 changed files with 4 additions and 2 deletions

View File

@ -358,13 +358,14 @@ void cInterfaceEGL::Shutdown() {
}
if (egl_ctx) {
eglMakeCurrent(egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
if (!eglDestroyContext(egl_dpy, egl_ctx))
NOTICE_LOG(G3D, "Could not destroy drawing context.");
if (!eglDestroySurface(egl_dpy, egl_surf))
NOTICE_LOG(G3D, "Could not destroy window surface.");
if (!eglDestroyContext(egl_dpy, egl_ctx))
NOTICE_LOG(G3D, "Could not destroy drawing context.");
if (!eglTerminate(egl_dpy))
NOTICE_LOG(G3D, "Could not destroy display connection.");
egl_ctx = nullptr;
egl_dpy = nullptr;
egl_surf = nullptr;
}
}

View File

@ -94,6 +94,7 @@ bool AndroidEGLGraphicsContext::Init(ANativeWindow *wnd, int backbufferWidth, in
void AndroidEGLGraphicsContext::Shutdown() {
gl->ClearCurrent();
gl->Shutdown();
delete gl;
ANativeWindow_release(wnd_);
}