safely destroy bar on global remove

This commit is contained in:
sewn 2024-10-25 13:11:51 +03:00
parent 71cd713226
commit 871255529e
No known key found for this signature in database

5
dam.c
View file

@ -685,14 +685,13 @@ registry_handle_global(void *data, struct wl_registry *wl_registry,
static void
registry_handle_global_remove(void *data, struct wl_registry *registry, uint32_t name)
{
Bar *bar;
Bar *bar, *bar_tmp;
wl_list_for_each(bar, &bars, link) {
wl_list_for_each_safe(bar, bar_tmp, &bars, link)
if (bar->wl_name == name) {
bar_destroy(bar);
return;
}
}
}
static const struct wl_registry_listener registry_listener = {