Fix race between network client disconnect and network window deletion

This commit is contained in:
Jonathan G Rennison
2022-06-22 19:23:20 +01:00
parent ccef4baea6
commit ff064e06b8
7 changed files with 25 additions and 7 deletions

View File

@@ -3510,6 +3510,19 @@ void DeleteConstructionWindows()
}
}
/**
* Delete all windows that use network client functionality.
*/
void DeleteNetworkClientWindows()
{
/* Note: the container remains stable, even when deleting windows. */
for (const Window *w : Window::IterateUnordered()) {
if (w->window_desc->flags & WDF_NETWORK) {
delete w;
}
}
}
/** Delete all always on-top windows to get an empty screen */
void HideVitalWindows()
{