From 67299a18a5b3aecf4febf2818fdf8140a561df5d Mon Sep 17 00:00:00 2001
From: "Devin J. Pohly" <djpohly@gmail.com>
Date: Sun, 10 May 2020 01:04:31 -0500
Subject: make sure freed listeners are removed from list

---
 dwl.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dwl.c b/dwl.c
index 0e4441a..72f969e 100644
--- a/dwl.c
+++ b/dwl.c
@@ -501,6 +501,9 @@ destroynotify(struct wl_listener *listener, void *data)
 {
 	/* Called when the surface is destroyed and should never be shown again. */
 	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);
 }
 
-- 
cgit v1.2.3