wview: remove view from lookup table in destroyView before freeing — fix use-after-free race

This commit is contained in:
Ollie 2026-05-29 17:06:19 +02:00
parent 7fcfb0870d
commit 03fa233ff7
1 changed files with 5 additions and 0 deletions

View File

@ -318,6 +318,11 @@ static void destroyView(W_View * view)
return;
view->flags.alreadyDead = 1;
/* Remove from view lookup table before freeing memory.
* Otherwise a concurrent W_GetViewForWindow can return a
* dangling pointer after wfree(view) reuses the memory. */
view_table_remove(view->window);
/* delete the balloon text for the view, if there's any */
WMSetBalloonTextForView(NULL, view);