menu: fix UAF in client-list-combined-menu after window destruction

Update client-list-combined-menu when a window is destroyed to avoid
SEGFAULT when selecting an that window entry in it.
This commit is contained in:
Johan Malm 2024-10-23 20:47:50 +01:00 committed by Johan Malm
parent 2b1a694154
commit e912964f73
3 changed files with 32 additions and 5 deletions

View file

@ -2453,11 +2453,7 @@ view_destroy(struct view *view)
}
}
/* If we spawned a window menu, close it */
if (server->menu_current
&& server->menu_current->triggered_by_view == view) {
menu_close_root(server);
}
menu_on_view_destroy(view);
/*
* Destroy the view's scene tree. View methods assume this is non-NULL,