From dc2b6ab6b7cfe69625bd27eba250113e347953a9 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 2 Jul 2015 00:30:13 +0200 Subject: vo_opengl: X11: don't leak when GL init fails --- video/out/gl_x11.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'video') 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) -- cgit v1.2.3