[PATCH 1/6] compositor: use wl_list_for_each_safe when destroying output

Kristian Høgsberg krh at bitplanet.net
Mon Dec 19 07:12:08 PST 2011


On Mon, Dec 19, 2011 at 5:30 AM, Tiago Vignatti
<vignatti at freedesktop.org> wrote:
> From: Tiago Vignatti <tiago.vignatti at intel.com>
>
> Was causing an invalid read when the output is in fact destroyed. That's only
> visible (segfault on my machine) on drm compositor because it's the only
> backend trying to finish correct the compositor.

Very nice.  I pulled this and the rest of the series from your fd.o branch.

Kristian

> Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
> ---
>  compositor/compositor.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/compositor/compositor.c b/compositor/compositor.c
> index cb9b41f..fc75689 100644
> --- a/compositor/compositor.c
> +++ b/compositor/compositor.c
> @@ -1932,10 +1932,10 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
>  WL_EXPORT void
>  wlsc_compositor_shutdown(struct wlsc_compositor *ec)
>  {
> -       struct wlsc_output *output;
> +       struct wlsc_output *output, *next;
>
>        /* Destroy all outputs associated with this compositor */
> -       wl_list_for_each(output, &ec->output_list, link)
> +       wl_list_for_each_safe(output, next, &ec->output_list, link)
>                output->destroy(output);
>  }
>
> --
> 1.7.5.4
>
> _______________________________________________
> 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