[PATCH weston v2] backends: don't destroy renderer and output twice

Derek Foreman derekf at osg.samsung.com
Wed Aug 5 14:05:34 PDT 2015


Looks good

Reviewed-by: Derek Foreman <derekf at osg.samsung.com>

On 30/07/15 10:02 PM, Dawid Gajownik wrote:
> drm, fbdev, rpi and wayland backends are unnecessarily destroying
> renderer and output before executing weston_compositor_shutdown()
> 
> Signed-off-by: Dawid Gajownik <gajownik at gmail.com>
> ---
>  src/compositor-drm.c     |  1 -
>  src/compositor-fbdev.c   |  5 +----
>  src/compositor-rpi.c     |  7 ++-----
>  src/compositor-wayland.c | 10 +---------
>  4 files changed, 4 insertions(+), 19 deletions(-)
> 
> diff --git a/src/compositor-drm.c b/src/compositor-drm.c
> index 3cb6b84..34a4ea9 100644
> --- a/src/compositor-drm.c
> +++ b/src/compositor-drm.c
> @@ -3163,7 +3163,6 @@ err_drm_source:
>  err_udev_input:
>  	udev_input_destroy(&b->input);
>  err_sprite:
> -	compositor->renderer->destroy(compositor);
>  	gbm_device_destroy(b->gbm);
>  	destroy_sprites(b);
>  err_udev_dev:
> diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
> index 3110f74..051a381 100644
> --- a/src/compositor-fbdev.c
> +++ b/src/compositor-fbdev.c
> @@ -881,16 +881,13 @@ fbdev_backend_create(struct weston_compositor *compositor, int *argc, char *argv
>  	}
>  
>  	if (fbdev_output_create(backend, param->device) < 0)
> -		goto out_pixman;
> +		goto out_launcher;
>  
>  	udev_input_init(&backend->input, compositor, backend->udev, seat_id);
>  
>  	compositor->backend = &backend->base;
>  	return backend;
>  
> -out_pixman:
> -	compositor->renderer->destroy(compositor);
> -
>  out_launcher:
>  	weston_launcher_destroy(compositor->launcher);
>  
> diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
> index ac9faeb..602cbee 100644
> --- a/src/compositor-rpi.c
> +++ b/src/compositor-rpi.c
> @@ -522,20 +522,17 @@ rpi_backend_create(struct weston_compositor *compositor,
>  		goto out_launcher;
>  
>  	if (rpi_output_create(backend, param->output_transform) < 0)
> -		goto out_renderer;
> +		goto out_launcher;
>  
>  	if (udev_input_init(&backend->input,
>  			    compositor,
>  			    backend->udev, "seat0") != 0) {
>  		weston_log("Failed to initialize udev input.\n");
> -		goto out_renderer;
> +		goto out_launcher;
>  	}
>  
>  	return backend;
>  
> -out_renderer:
> -	compositor->renderer->destroy(compositor);
> -
>  out_launcher:
>  	weston_launcher_destroy(compositor->launcher);
>  
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index a8e63e1..44b6ebb 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -2016,14 +2016,12 @@ wayland_backend_create(struct weston_compositor *compositor, int use_pixman,
>  		wl_event_loop_add_fd(loop, fd, WL_EVENT_READABLE,
>  				     wayland_backend_handle_event, b);
>  	if (b->parent.wl_source == NULL)
> -		goto err_renderer;
> +		goto err_display;
>  
>  	wl_event_source_check(b->parent.wl_source);
>  
>  	compositor->backend = &b->base;
>  	return b;
> -err_renderer:
> -	compositor->renderer->destroy(compositor);
>  err_display:
>  	wl_display_disconnect(b->parent.wl_display);
>  err_compositor:
> @@ -2035,12 +2033,6 @@ err_compositor:
>  static void
>  wayland_backend_destroy(struct wayland_backend *b)
>  {
> -	struct weston_output *output, *next;
> -
> -	wl_list_for_each_safe(output, next, &b->compositor->output_list, link)
> -		wayland_output_destroy(output);
> -
> -	b->compositor->renderer->destroy(b->compositor);
>  	wl_display_disconnect(b->parent.wl_display);
>  
>  	if (b->theme)
> 



More information about the wayland-devel mailing list