diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-08-30 10:17:51 +0200 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-08-30 10:17:51 +0200 |
commit | 593e5e4a25812662478d830e1effbc1bb5f3b97e (patch) | |
tree | 10d8d4b46ea318fa5f89efc12315340a9a1bb498 /video/out | |
parent | ce93ee8bd0460725f8c26657781cc52abb48384c (diff) | |
download | mpv-593e5e4a25812662478d830e1effbc1bb5f3b97e.tar.bz2 mpv-593e5e4a25812662478d830e1effbc1bb5f3b97e.tar.xz |
gl_wayland: fix crash after eglInitialze failed
Only execute most of the opengl termination procedure if we actually have an
egl context.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/gl_wayland.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/video/out/gl_wayland.c b/video/out/gl_wayland.c index ca98a26c63..3e54f11962 100644 --- a/video/out/gl_wayland.c +++ b/video/out/gl_wayland.c @@ -183,12 +183,14 @@ static void releaseGlContext_wayland(MPGLContext *ctx) GL *gl = ctx->gl; struct vo_wayland_state *wl = ctx->vo->wayland; - gl->Finish(); - eglReleaseThread(); - wl_egl_window_destroy(wl->egl_context.egl_window); - eglDestroySurface(wl->egl_context.egl.dpy, wl->egl_context.egl_surface); - eglMakeCurrent(wl->egl_context.egl.dpy, NULL, NULL, EGL_NO_CONTEXT); - eglDestroyContext(wl->egl_context.egl.dpy, wl->egl_context.egl.ctx); + if (wl->egl_context.egl.ctx) { + gl->Finish(); + eglReleaseThread(); + wl_egl_window_destroy(wl->egl_context.egl_window); + eglDestroySurface(wl->egl_context.egl.dpy, wl->egl_context.egl_surface); + eglMakeCurrent(wl->egl_context.egl.dpy, NULL, NULL, EGL_NO_CONTEXT); + eglDestroyContext(wl->egl_context.egl.dpy, wl->egl_context.egl.ctx); + } eglTerminate(wl->egl_context.egl.dpy); wl->egl_context.egl.ctx = NULL; } |