Don't segfault on fullscreen swapping.

This commit is contained in:
Themaister 2012-09-15 15:41:12 +02:00
parent b9f605cc9d
commit 6052af0327

View File

@ -324,7 +324,11 @@ void gfx_ctx_destroy(void)
if (g_egl_dpy)
{
if (g_egl_ctx)
{
eglMakeCurrent(g_egl_dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroyContext(g_egl_dpy, g_egl_ctx);
}
if (g_egl_surf)
eglDestroySurface(g_egl_dpy, g_egl_surf);
eglTerminate(g_egl_dpy);
@ -333,9 +337,11 @@ void gfx_ctx_destroy(void)
g_egl_ctx = NULL;
g_egl_surf = NULL;
g_egl_dpy = NULL;
g_config = 0;
if (g_win)
{
XUnmapWindow(g_dpy, g_win);
XDestroyWindow(g_dpy, g_win);
g_win = None;
}