1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-24 00:03:11 +01:00

Fix segfault if no RCT2 install path

This commit is contained in:
Ted John
2018-02-10 21:37:25 +00:00
parent e996c83b70
commit 3c29b15de9

View File

@@ -818,6 +818,11 @@ void window_close_top()
*/ */
void window_close_all() void window_close_all()
{ {
if (gWindowNextSlot == nullptr)
{
return;
}
window_close_by_class(WC_DROPDOWN); window_close_by_class(WC_DROPDOWN);
for (rct_window * w = RCT2_LAST_WINDOW; w >= g_window_list; w--) for (rct_window * w = RCT2_LAST_WINDOW; w >= g_window_list; w--)
@@ -2667,11 +2672,7 @@ void window_reset_visibilities()
void window_init_all() void window_init_all()
{ {
if (gWindowNextSlot != nullptr) window_close_all();
{
window_close_all();
}
gWindowNextSlot = g_window_list; gWindowNextSlot = g_window_list;
} }