From e67f6c0113fb47dee4f223faeb1ae105c4c95d13 Mon Sep 17 00:00:00 2001 From: tiosgz Date: Sat, 6 Nov 2021 17:50:14 +0000 Subject: [PATCH] deref decoration::view although the targeted situation should (according to the protocol) never occur, there is something that triggers it from time to time (maybe wlroots?) --- kiwmi/desktop/xdg_shell.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/kiwmi/desktop/xdg_shell.c b/kiwmi/desktop/xdg_shell.c index 62bc41d..a4e4bfb 100644 --- a/kiwmi/desktop/xdg_shell.c +++ b/kiwmi/desktop/xdg_shell.c @@ -239,6 +239,10 @@ xdg_surface_destroy_notify(struct wl_listener *listener, void *UNUSED(data)) view_child_destroy(child); } + if (view->decoration) { + view->decoration->view = NULL; + } + wl_list_remove(&view->link); wl_list_remove(&view->children); wl_list_remove(&view->map.link); @@ -511,7 +515,9 @@ xdg_decoration_destroy_notify(struct wl_listener *listener, void *UNUSED(data)) struct kiwmi_xdg_decoration *decoration = wl_container_of(listener, decoration, destroy); - decoration->view->decoration = NULL; + if (decoration->view) { + decoration->view->decoration = NULL; + } wl_list_remove(&decoration->destroy.link); wl_list_remove(&decoration->request_mode.link);