make sure freed listeners are removed from list

This commit is contained in:
Devin J. Pohly 2020-05-10 01:04:31 -05:00
parent abab2ed92a
commit 67299a18a5

3
dwl.c
View file

@ -501,6 +501,9 @@ destroynotify(struct wl_listener *listener, void *data)
{ {
/* Called when the surface is destroyed and should never be shown again. */ /* Called when the surface is destroyed and should never be shown again. */
Client *c = wl_container_of(listener, c, destroy); Client *c = wl_container_of(listener, c, destroy);
wl_list_remove(&c->map.link);
wl_list_remove(&c->unmap.link);
wl_list_remove(&c->destroy.link);
free(c); free(c);
} }