vo_opengl: X11: don't leak when GL init fails

This commit is contained in:
wm4 2015-07-02 00:30:13 +02:00
parent 89713808ad
commit dc2b6ab6b7
1 changed files with 4 additions and 1 deletions

View File

@ -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)