From 1670de0a4edbfe20f604d82a1ee2f00785e732fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 26 Mar 2023 23:39:59 +0200 Subject: [PATCH] Fix guest window accessing members after it is deleted Calling `Close()` on a window deletes its object, rendering any future uses of its members invalid. --- src/openrct2-ui/windows/Guest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index df87dc5461..609197f2c1 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -207,7 +207,7 @@ public: { case WIDX_CLOSE: Close(); - break; + return; case WIDX_TAB_1: case WIDX_TAB_2: case WIDX_TAB_3: @@ -216,7 +216,7 @@ public: case WIDX_TAB_6: case WIDX_TAB_7: SetPage(widx - WIDX_TAB_1); - break; + return; } switch (page)