xwayland: clear wlr_xwayland_surface in handle_destroy

Avoids wlr_xwayland_surface becoming a dangling pointer if a view is not
destroyed immediately.

See swaywm/sway@215787e8
This commit is contained in:
Johan Malm 2021-10-20 20:34:47 +01:00
parent fb6792f12c
commit 26454e3115

View file

@ -81,6 +81,7 @@ handle_destroy(struct wl_listener *listener, void *data)
if (view->toplevel_handle) { if (view->toplevel_handle) {
wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle); wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
} }
view->xwayland_surface = NULL;
wl_list_remove(&view->link); wl_list_remove(&view->link);
wl_list_remove(&view->map.link); wl_list_remove(&view->map.link);
wl_list_remove(&view->unmap.link); wl_list_remove(&view->unmap.link);