From ba30f781f4fcc931a2287ca2363e68ff2675dbab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Wed, 4 Dec 2024 21:18:25 +0200 Subject: [PATCH] Remove WindowFlushDead, shouldn't be used directly --- src/openrct2/interface/Window.cpp | 9 ++------- src/openrct2/interface/Window.h | 1 - 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 9522898e41..300ac9a1db 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -141,7 +141,8 @@ void WindowUpdateAllViewports() */ void WindowUpdateAll() { - WindowFlushDead(); + // Remove all windows in g_window_list that have the WF_DEAD flag + g_window_list.remove_if([](auto&& w) -> bool { return w->flags & WF_DEAD; }); // Periodic update happens every second so 40 ticks. if (gCurrentRealTimeTicks >= gWindowUpdateTicks) @@ -237,12 +238,6 @@ void WindowClose(WindowBase& w) w.flags |= WF_DEAD; } -void WindowFlushDead() -{ - // Remove all windows in g_window_list that have the WF_DEAD flag - g_window_list.remove_if([](auto&& w) -> bool { return w->flags & WF_DEAD; }); -} - template static void WindowCloseByCondition(TPred pred, uint32_t flags = WindowCloseFlags::None) { diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index e01bb155e3..f9d38390b7 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -475,7 +475,6 @@ WindowBase* WindowBringToFrontByClassWithFlags(WindowClass cls, uint16_t flags); WindowBase* WindowBringToFrontByNumber(WindowClass cls, rct_windownumber number); void WindowClose(WindowBase& window); -void WindowFlushDead(); void WindowCloseByClass(WindowClass cls); void WindowCloseByNumber(WindowClass cls, rct_windownumber number); void WindowCloseByNumber(WindowClass cls, EntityId number);