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
1 changed files with 3 additions and 1 deletions

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);
}