screen-share: Use wl_list_for_each_safe on destroy

Destroying the shared seat removes the link from so->seat_list.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Acked-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Daniel Stone
2017-02-16 19:59:51 +00:00
committed by Bryce Harrington
parent f81959e39d
commit f589dac2b0
+2 -2
View File
@@ -884,7 +884,7 @@ shared_output_create(struct weston_output *output, int parent_fd)
{ {
struct shared_output *so; struct shared_output *so;
struct wl_event_loop *loop; struct wl_event_loop *loop;
struct ss_seat *seat; struct ss_seat *seat, *tmp;
int epoll_fd; int epoll_fd;
so = zalloc(sizeof *so); so = zalloc(sizeof *so);
@@ -972,7 +972,7 @@ shared_output_create(struct weston_output *output, int parent_fd)
return so; return so;
err_display: err_display:
wl_list_for_each(seat, &so->seat_list, link) wl_list_for_each_safe(seat, tmp, &so->seat_list, link)
ss_seat_destroy(seat); ss_seat_destroy(seat);
wl_display_disconnect(so->parent.display); wl_display_disconnect(so->parent.display);
err_alloc: err_alloc: