summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-07-02 00:30:13 +0200
committerwm4 <wm4@nowhere>2015-07-02 00:30:13 +0200
commitdc2b6ab6b7cfe69625bd27eba250113e347953a9 (patch)
tree530e4bea28715a3d5eae18b33b22e3aeb4de7ee6
parent89713808ada054df74fd413e02ea32023badf30d (diff)
downloadmpv-dc2b6ab6b7cfe69625bd27eba250113e347953a9.tar.bz2
mpv-dc2b6ab6b7cfe69625bd27eba250113e347953a9.tar.xz
vo_opengl: X11: don't leak when GL init fails
-rw-r--r--video/out/gl_x11.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/video/out/gl_x11.c b/video/out/gl_x11.c
index eeaa01f94c..9226356b66 100644
--- a/video/out/gl_x11.c
+++ b/video/out/gl_x11.c
@@ -257,7 +257,10 @@ static bool config_window_x11(struct MPGLContext *ctx, int flags)
static int glx_init(struct MPGLContext *ctx, int vo_flags)
{
- return vo_x11_init(ctx->vo) && config_window_x11(ctx, vo_flags) ? 0 : -1;
+ if (vo_x11_init(ctx->vo) && config_window_x11(ctx, vo_flags))
+ return 0;
+ vo_x11_uninit(ctx->vo);
+ return -1;
}
static int glx_reconfig(struct MPGLContext *ctx, int flags)