diff options
author | dudemanguy <random342@airmail.cc> | 2019-10-03 09:29:07 -0500 |
---|---|---|
committer | Dudemanguy911 <random342@airmail.cc> | 2019-10-03 14:56:43 +0000 |
commit | fd7aff7a9d9c45cb0f9ef1e7e7254e585b26a114 (patch) | |
tree | 448a0df1af3995ea42bc40eb7a78ddcdccd294b4 /video/out | |
parent | 9d6ae83fdc254cf92d2f02bcd33ff66e5a900a1c (diff) | |
download | mpv-fd7aff7a9d9c45cb0f9ef1e7e7254e585b26a114.tar.bz2 mpv-fd7aff7a9d9c45cb0f9ef1e7e7254e585b26a114.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/opengl/context_wayland.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); } |