[PATCH weston 1/2] compositor: don't crash if destroying a compositor without a backend

Derek Foreman derekf at osg.samsung.com
Mon Oct 5 14:45:45 PDT 2015


Pushed both in this series.

Thanks,
Derek

On 03/10/15 08:25 AM, Giulio Camuffo wrote:
> Calling weston_compositor_destroy() on a pointer returned by
> weston_compositor_create() should be always valid, even if the
> compositor does not have yet a backend.
> 
> Signed-off-by: Giulio Camuffo <giuliocamuffo at gmail.com>
> ---
>  src/compositor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/compositor.c b/src/compositor.c
> index 125afd5..f8437e8 100644
> --- a/src/compositor.c
> +++ b/src/compositor.c
> @@ -4767,7 +4767,8 @@ weston_compositor_destroy(struct weston_compositor *compositor)
>  
>  	weston_compositor_xkb_destroy(compositor);
>  
> -	compositor->backend->destroy(compositor);
> +	if (compositor->backend)
> +		compositor->backend->destroy(compositor);
>  	free(compositor);
>  }
>  
> 



More information about the wayland-devel mailing list