diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-08 22:16:41 +0100 |
---|---|---|
committer | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-08 22:16:41 +0100 |
commit | c555b2ae55808d0a86b5187cfbb2c3690c418f8e (patch) | |
tree | 223e661f8bba8a1ee7d06c9748a382fd98abc784 /video/out | |
parent | 525c7f1addacc684b66e9d5f73890347e0879261 (diff) | |
download | mpv-c555b2ae55808d0a86b5187cfbb2c3690c418f8e.tar.bz2 mpv-c555b2ae55808d0a86b5187cfbb2c3690c418f8e.tar.xz |
wayland: properly empty output list
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/wayland_common.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index d3fbd8eadf..716a0c2b65 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -762,17 +762,17 @@ static bool create_display (struct vo_wayland_state *wl) static void destroy_display (struct vo_wayland_state *wl) { - struct vo_wayland_output *output; + struct vo_wayland_output *output = NULL; + struct vo_wayland_output *tmp = NULL; - wl_list_for_each(output, &wl->display.output_list, link) { + wl_list_for_each_safe(output, tmp, &wl->display.output_list, link) { if (output && output->output) { wl_output_destroy(output->output); output->output = NULL; + wl_list_remove(&output->link); } } - wl_list_empty(&wl->display.output_list); - if (wl->display.shm) wl_shm_destroy(wl->display.shm); |