diff --git a/WINGs/wview.c b/WINGs/wview.c index 0029937..aa16848 100644 --- a/WINGs/wview.c +++ b/WINGs/wview.c @@ -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);