diff options
author | Alexander Preisinger <alexander.preisinger@gmail.com> | 2014-01-08 22:16:41 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-01-15 20:51:39 +0100 |
commit | 9fabf85a4465d722d2702097ade1bf6f718cbd3e (patch) | |
tree | 72a2269b771950829dfae96a8b5379a7ff0c756b /video/out/wayland_common.c | |
parent | 54fd5d09790c655e5c180658ae00bcb5250c789a (diff) | |
download | mpv-9fabf85a4465d722d2702097ade1bf6f718cbd3e.tar.bz2 mpv-9fabf85a4465d722d2702097ade1bf6f718cbd3e.tar.xz |
wayland: properly empty output list
Diffstat (limited to 'video/out/wayland_common.c')
-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 616a9cc888..b0121d8ec7 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -658,17 +658,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); |