Kill window_exists call in show_menus

Hidden windows don't receive events, so the only way to close is outside its handler, which there should be no cases of here. The function window_exists could return a false positive if a new window was created with the same pointer value as a deleted one. Will later disable window_exists function.
This commit is contained in:
Chris Taylor 2016-10-28 08:58:47 +08:00
parent 917f079f02
commit e44013ebcf

View file

@ -192,7 +192,12 @@ void show_menus(void)
{
if (!i)
break;
if (window_exists(i))
// Hidden windows don't receive events, so the only way to close is outside its handler
// Which there should be no cases of here
// window_exists could return a false positive if a new window was created
// with the same pointer value as the deleted one, so killing window_exists (call and function)
// if (window_exists(i))
window_set_visible(i, 1);
}
menus[0] = NULL;