[PATCH? weston] - wayland backend: outputs are destroyed twice

Bryce Harrington bryce at osg.samsung.com
Thu Jul 30 18:47:40 PDT 2015


On Thu, Jul 30, 2015 at 10:00:29AM -0300, Dawid Gajownik wrote:
> Hi Ryo,
> 
> good catch. I missed this one.

Mind re-posting the patch, with updated changelog accounting for
dropping the redundant renderer destruction.

I did a quick look through the other compositor codes in case they
contained similar code, but didn't spot anything.  Did you check as
well?

Anyway, looks good.

Reviewed-by: Bryce Harrington <bryce at osg.samsung.com>
 
> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> index a8e63e1..70f0939 100644
> --- a/src/compositor-wayland.c
> +++ b/src/compositor-wayland.c
> @@ -2035,12 +2035,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)
> 
> On Thu, Jul 30, 2015 at 12:03 AM, Ryo Munakata <ryomnktml at gmail.com> wrote:
> > On 07/29, Dawid Gajownik wrote:
> >
> > Hi Dawid.
> >
> >> Hi,
> >>
> >> in src/compositor-wayland.c:wayland_backend_destroy() you can find this code:
> >>
> >>         struct weston_output *output, *next;
> >>
> >>         wl_list_for_each_safe(output, next, &b->compositor->output_list, link)
> >>                 wayland_output_destroy(output);
> >> [snip]
> >>         weston_compositor_shutdown(b->compositor);
> >>
> >> but src/compositor.c:weston_compositor_shutdown() also removes the outputs:
> >>
> >>         /* Destroy all outputs associated with this compositor */
> >>         wl_list_for_each_safe(output, next, &ec->output_list, link)
> >>                 output->destroy(output);
> >>
> >> destroy() is assign in src/compositor-wayland.c:wayland_output_create()
> >>
> >>         output->base.destroy = wayland_output_destroy;
> >>
> >> Maybe it will be safe to remove unnecessary calls to wayland_output_destroy()?
> >>
> >> Thanks,
> >>     Dawid
> >>
> >> diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
> >> index a8e63e1..5c4ad11 100644
> >> --- a/src/compositor-wayland.c
> >> +++ b/src/compositor-wayland.c
> >> @@ -2035,11 +2035,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);
> >
> > The renderer is also destroyed twice in both wayland_backend_destroy and
> > weston_compositor_shutdown.
> >
> > Thanks.
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list