diff options
author | wm4 <wm4@nowhere> | 2014-12-03 22:37:39 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-12-03 23:01:19 +0100 |
commit | 19f9a7066ea3c5ca9c185e902465bd40bda4883c (patch) | |
tree | ecebaaead0a80069d6cd8cfaff4ab6508c14d432 /video | |
parent | 920512d358221effa851da8a64fd26a54d154605 (diff) | |
download | mpv-19f9a7066ea3c5ca9c185e902465bd40bda4883c.tar.bz2 mpv-19f9a7066ea3c5ca9c185e902465bd40bda4883c.tar.xz |
vo_opengl: make uninit idempotent
Diffstat (limited to 'video')
-rw-r--r-- | video/out/gl_video.c | 3 | ||||
-rw-r--r-- | video/out/vo_opengl.c | 9 |
2 files changed, 6 insertions, 6 deletions
diff --git a/video/out/gl_video.c b/video/out/gl_video.c index d2d0c2e571..07ba0bd602 100644 --- a/video/out/gl_video.c +++ b/video/out/gl_video.c @@ -2197,6 +2197,9 @@ static int init_gl(struct gl_video *p) void gl_video_uninit(struct gl_video *p) { + if (!p) + return; + GL *gl = p->gl; uninit_video(p); diff --git a/video/out/vo_opengl.c b/video/out/vo_opengl.c index 7993b0a3e7..2043a4cd3c 100644 --- a/video/out/vo_opengl.c +++ b/video/out/vo_opengl.c @@ -392,12 +392,9 @@ static void uninit(struct vo *vo) { struct gl_priv *p = vo->priv; - if (p->glctx) { - if (p->renderer) - gl_video_uninit(p->renderer); - gl_hwdec_uninit(p->hwdec); - mpgl_uninit(p->glctx); - } + gl_video_uninit(p->renderer); + gl_hwdec_uninit(p->hwdec); + mpgl_uninit(p->glctx); } static int preinit(struct vo *vo) |