Fix potential npd on view destroy.

This commit is contained in:
project-repo 2020-10-24 09:45:33 +02:00
commit a2e0a55d2e

View file

@ -282,6 +282,7 @@ handle_xdg_shell_surface_unmap(struct wl_listener *listener, void *_data) {
wl_container_of(listener, xdg_shell_view, unmap);
struct cg_view *view = &xdg_shell_view->view;
wl_list_remove(&xdg_shell_view->new_popup.link);
wl_list_remove(&xdg_shell_view->commit.link);
view_unmap(view);
@ -316,7 +317,6 @@ handle_xdg_shell_surface_destroy(struct wl_listener *listener, void *_data) {
wl_list_remove(&xdg_shell_view->unmap.link);
wl_list_remove(&xdg_shell_view->destroy.link);
wl_list_remove(&xdg_shell_view->request_fullscreen.link);
wl_list_remove(&xdg_shell_view->new_popup.link);
xdg_shell_view->xdg_surface = NULL;
view_destroy(view);