From 33753816106a2da390973491260137dd5ddb24cd Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 10 Aug 2017 22:23:46 -0400 Subject: Fix segfault during xdg-shell cleanup --- examples/compositor/xdg_shell.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples/compositor') diff --git a/examples/compositor/xdg_shell.c b/examples/compositor/xdg_shell.c index 2efeecfa..98aa47a0 100644 --- a/examples/compositor/xdg_shell.c +++ b/examples/compositor/xdg_shell.c @@ -197,8 +197,8 @@ void xdg_shell_release(struct xdg_shell_state *state) { return; } - struct wl_resource *resource = NULL; - wl_resource_for_each(resource, &state->wl_resources) { + struct wl_resource *resource = NULL, *temp = NULL; + wl_resource_for_each_safe(resource, temp, &state->wl_resources) { struct wl_list *link = wl_resource_get_link(resource); wl_list_remove(link); } -- cgit v1.2.3