From fd7aff7a9d9c45cb0f9ef1e7e7254e585b26a114 Mon Sep 17 00:00:00 2001 From: dudemanguy Date: Thu, 3 Oct 2019 09:29:07 -0500 Subject: 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. --- video/out/opengl/context_wayland.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/video/out/opengl/context_wayland.c b/video/out/opengl/context_wayland.c index 3ce42ad01b..22c18d8290 100644 --- a/video/out/opengl/context_wayland.c +++ b/video/out/opengl/context_wayland.c @@ -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); } -- cgit v1.2.3