mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Fix #9752: window_close from ride construction window causes a crash
Re-obtain iterator after calling window close event as close event may open / close other windows.
This commit is contained in:
@@ -230,7 +230,10 @@ void window_close(rct_window* w)
|
||||
// Invalidate the window (area)
|
||||
window_invalidate(window.get());
|
||||
|
||||
g_window_list.erase(itWindow);
|
||||
// The window list may have been modified in the close event
|
||||
itWindow = window_get_iterator(w);
|
||||
if (itWindow != g_window_list.end())
|
||||
g_window_list.erase(itWindow);
|
||||
}
|
||||
|
||||
template<typename _TPred> static void window_close_by_condition(_TPred pred, uint32_t flags = WindowCloseFlags::None)
|
||||
|
||||
Reference in New Issue
Block a user