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 <tiago.vignatti@intel.com>
This commit is contained in:
Tiago Vignatti 2011-12-18 22:27:40 +02:00
parent 7bb92f0c03
commit b303a1d3fc

View File

@ -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);
}