diff options
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 9c703e3546..c553533ec2 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -659,6 +659,20 @@ static bool create_display (struct vo_wayland_state *wl) static void destroy_display (struct vo_wayland_state *wl) { + struct vo_wayland_output *output; + + wl_list_for_each(output, &wl->display.output_list, link) { + if (output && output->output) { + wl_output_destroy(output->output); + output->output = NULL; + } + } + + wl_list_empty(&wl->display.output_list); + + if (wl->display.shm) + wl_shm_destroy(wl->display.shm); + if (wl->display.shell) wl_shell_destroy(wl->display.shell); @@ -667,6 +681,7 @@ static void destroy_display (struct vo_wayland_state *wl) if (wl->display.registry) wl_registry_destroy(wl->display.registry); + if (wl->display.display) { wl_display_flush(wl->display.display); wl_display_disconnect(wl->display.display); @@ -697,6 +712,7 @@ static void destroy_window (struct vo_wayland_state *wl) { if (wl->window.shell_surface) wl_shell_surface_destroy(wl->window.shell_surface); + if (wl->window.surface) wl_surface_destroy(wl->window.surface); } @@ -748,6 +764,7 @@ static void destroy_input (struct vo_wayland_state *wl) xkb_map_unref(wl->input.xkb.keymap); xkb_state_unref(wl->input.xkb.state); } + if (wl->input.xkb.context) xkb_context_unref(wl->input.xkb.context); |