Re: [PATCH weston 2/2] screen-share: Use wl_list_for_each_safe on destroy

2017-02-21 Thread Bryce Harrington
On Thu, Feb 16, 2017 at 07:59:51PM +, Daniel Stone wrote:
> Destroying the shared seat removes the link from so->seat_list.
> 
> Signed-off-by: Daniel Stone 

Acked-by: Bryce Harrington 

> ---
>  compositor/screen-share.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/compositor/screen-share.c b/compositor/screen-share.c
> index 069da1d..a6f82b1 100644
> --- a/compositor/screen-share.c
> +++ b/compositor/screen-share.c
> @@ -884,7 +884,7 @@ shared_output_create(struct weston_output *output, int 
> parent_fd)
>  {
>   struct shared_output *so;
>   struct wl_event_loop *loop;
> - struct ss_seat *seat;
> + struct ss_seat *seat, *tmp;
>   int epoll_fd;
>  
>   so = zalloc(sizeof *so);
> @@ -972,7 +972,7 @@ shared_output_create(struct weston_output *output, int 
> parent_fd)
>   return so;
>  
>  err_display:
> - wl_list_for_each(seat, >seat_list, link)
> + wl_list_for_each_safe(seat, tmp, >seat_list, link)
>   ss_seat_destroy(seat);
>   wl_display_disconnect(so->parent.display);
>  err_alloc:
> -- 
> 2.9.3
> 
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH weston 2/2] screen-share: Use wl_list_for_each_safe on destroy

2017-02-20 Thread Pekka Paalanen
On Thu, 16 Feb 2017 19:59:51 +
Daniel Stone  wrote:

> Destroying the shared seat removes the link from so->seat_list.
> 
> Signed-off-by: Daniel Stone 
> ---
>  compositor/screen-share.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/compositor/screen-share.c b/compositor/screen-share.c
> index 069da1d..a6f82b1 100644
> --- a/compositor/screen-share.c
> +++ b/compositor/screen-share.c
> @@ -884,7 +884,7 @@ shared_output_create(struct weston_output *output, int 
> parent_fd)
>  {
>   struct shared_output *so;
>   struct wl_event_loop *loop;
> - struct ss_seat *seat;
> + struct ss_seat *seat, *tmp;
>   int epoll_fd;
>  
>   so = zalloc(sizeof *so);
> @@ -972,7 +972,7 @@ shared_output_create(struct weston_output *output, int 
> parent_fd)
>   return so;
>  
>  err_display:
> - wl_list_for_each(seat, >seat_list, link)
> + wl_list_for_each_safe(seat, tmp, >seat_list, link)
>   ss_seat_destroy(seat);
>   wl_display_disconnect(so->parent.display);
>  err_alloc:

Both patches:
Reviewed-by: Pekka Paalanen 

And also look fine to land for the release, IMO.


Thanks,
pq


pgpwyy_CHzMpB.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 2/2] screen-share: Use wl_list_for_each_safe on destroy

2017-02-16 Thread Daniel Stone
Destroying the shared seat removes the link from so->seat_list.

Signed-off-by: Daniel Stone 
---
 compositor/screen-share.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/compositor/screen-share.c b/compositor/screen-share.c
index 069da1d..a6f82b1 100644
--- a/compositor/screen-share.c
+++ b/compositor/screen-share.c
@@ -884,7 +884,7 @@ shared_output_create(struct weston_output *output, int 
parent_fd)
 {
struct shared_output *so;
struct wl_event_loop *loop;
-   struct ss_seat *seat;
+   struct ss_seat *seat, *tmp;
int epoll_fd;
 
so = zalloc(sizeof *so);
@@ -972,7 +972,7 @@ shared_output_create(struct weston_output *output, int 
parent_fd)
return so;
 
 err_display:
-   wl_list_for_each(seat, >seat_list, link)
+   wl_list_for_each_safe(seat, tmp, >seat_list, link)
ss_seat_destroy(seat);
wl_display_disconnect(so->parent.display);
 err_alloc:
-- 
2.9.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel