[PATCH weston 2/2] compositor-wayland: Destroy cursor images earlier

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 29 00:10:17 UTC 2016


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 <daniels at collabora.com>

Reviewed-by: Peter Hutterer <peter.hutterer at 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 at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
> 


More information about the wayland-devel mailing list