From b303a1d3fcb4d7dde855b3e4babf27a8ab202046 Mon Sep 17 00:00:00 2001 From: Tiago Vignatti Date: Sun, 18 Dec 2011 22:27:40 +0200 Subject: [PATCH] compositor: use wl_list_for_each_safe when destroying output 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. Signed-off-by: Tiago Vignatti --- compositor/compositor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compositor/compositor.c b/compositor/compositor.c index cb9b41fd..fc75689a 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); }