On Thu, Nov 24, 2016 at 03:32:41PM +0000, Daniel Stone wrote:
> Destroying a wl_cursor will attempt to access the wl_display, which
> we have just freed. Avoid a segfault by destroying the cursor images
> before we destroy the display.
> 
> Signed-off-by: Daniel Stone <dani...@collabora.com>

Reviewed-by: Peter Hutterer <peter.hutte...@who-t.net>

Cheers,
   Peter
> ---
>  libweston/compositor-wayland.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
> index d9cbde5..aa69c68 100644
> --- a/libweston/compositor-wayland.c
> +++ b/libweston/compositor-wayland.c
> @@ -2368,10 +2368,6 @@ wayland_destroy(struct weston_compositor *ec)
>       if (b->parent.compositor)
>               wl_compositor_destroy(b->parent.compositor);
>  
> -     wl_registry_destroy(b->parent.registry);
> -     wl_display_flush(b->parent.wl_display);
> -     wl_display_disconnect(b->parent.wl_display);
> -
>       if (b->theme)
>               theme_destroy(b->theme);
>  
> @@ -2380,6 +2376,10 @@ wayland_destroy(struct weston_compositor *ec)
>  
>       wl_cursor_theme_destroy(b->cursor_theme);
>  
> +     wl_registry_destroy(b->parent.registry);
> +     wl_display_flush(b->parent.wl_display);
> +     wl_display_disconnect(b->parent.wl_display);
> +
>       free(b);
>  }
>  
> -- 
> 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

Reply via email to