From 56644b8abcb5478f7ba316efbcb3fb4facd7c418 Mon Sep 17 00:00:00 2001 From: Alexander Preisinger Date: Mon, 26 Aug 2013 18:35:57 +0200 Subject: wayland: fix memory leaks --- video/out/vo_wayland.c | 3 +++ video/out/wayland_common.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/video/out/vo_wayland.c b/video/out/vo_wayland.c index 9871503b81..cd39158250 100644 --- a/video/out/vo_wayland.c +++ b/video/out/vo_wayland.c @@ -525,6 +525,7 @@ static int query_format(struct vo *vo, uint32_t format) static int reconfig(struct vo *vo, struct mp_image_params *fmt, int flags) { struct priv *p = vo->priv; + mp_image_unrefp(&p->original_image); p->width = vo->dwidth; p->height = vo->dheight; @@ -568,6 +569,8 @@ static void uninit(struct vo *vo) for (int i = 0; i < MAX_BUFFERS; ++i) destroy_shm_buffer(&p->buffers[i]); + talloc_free(p->original_image); + vo_wayland_uninit(vo); } diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 7a79bb2873..47fc368ca0 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -687,8 +687,12 @@ static bool create_input (struct vo_wayland_state *wl) static void destroy_input (struct vo_wayland_state *wl) { - if (wl->input.keyboard) + if (wl->input.keyboard) { wl_keyboard_destroy(wl->input.keyboard); + xkb_map_unref(wl->input.xkb.keymap); + xkb_state_unref(wl->input.xkb.state); + xkb_context_unref(wl->input.xkb.context); + } if (wl->input.pointer) wl_pointer_destroy(wl->input.pointer); @@ -696,7 +700,6 @@ static void destroy_input (struct vo_wayland_state *wl) if (wl->input.seat) wl_seat_destroy(wl->input.seat); - xkb_context_unref(wl->input.xkb.context); } /*** mplayer2 interface ***/ -- cgit v1.2.3