From d6975a8f23be5abac2d94f1f2a5147a7af6b4d50 Mon Sep 17 00:00:00 2001 From: Matt Date: Tue, 4 Jun 2019 07:02:55 +0200 Subject: [PATCH] Fix #9365: Crash when bringing window to front --- src/openrct2/interface/Window.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 0bea48d6fc..c0ff64c0a9 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -681,9 +681,6 @@ rct_window* window_bring_to_front(rct_window* w) auto itSourcePos = window_get_iterator(w); if (itSourcePos != g_window_list.end()) { - auto wptr = std::move(*itSourcePos); - g_window_list.erase(itSourcePos); - // Insert in front of the first non-stick-to-front window auto itDestPos = g_window_list.begin(); for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) @@ -696,7 +693,7 @@ rct_window* window_bring_to_front(rct_window* w) } } - g_window_list.insert(itDestPos, std::move(wptr)); + g_window_list.splice(itDestPos, g_window_list, itSourcePos); window_invalidate(w); if (w->x + w->width < 20)