1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-28 10:02:17 +00:00

wayland opengl: actually call uninit if init fails

This is the proper fix to the memory leak @wm4 pointed out. It turns out
that when you autoprobe opengl and vo_wayland_init returns false,
vo_wayland_uninit is never actually executed. So you have a leftover
pointer. The vulkan context does this correctly which was why my old,
dumb "fix" broke it.
This commit is contained in:
dudemanguy 2019-10-03 09:29:07 -05:00 committed by Dudemanguy911
parent 9d6ae83fdc
commit fd7aff7a9d

View File

@ -165,8 +165,10 @@ static void wayland_egl_wait_events(struct ra_ctx *ctx, int64_t until_time_us)
static bool wayland_egl_init(struct ra_ctx *ctx)
{
if (!vo_wayland_init(ctx->vo))
if (!vo_wayland_init(ctx->vo)) {
vo_wayland_uninit(ctx->vo);
return false;
}
return egl_create_context(ctx);
}