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?)
This commit is contained in:
tiosgz 2021-11-06 17:50:14 +00:00
parent 3a0cf2ceb5
commit e67f6c0113

View file

@ -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);
if (decoration->view) {
decoration->view->decoration = NULL;
}
wl_list_remove(&decoration->destroy.link);
wl_list_remove(&decoration->request_mode.link);