1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-23 15:52:55 +01:00

Use primitive for loop for window iterations, iterators can invalidate

This commit is contained in:
Matt
2025-10-17 12:53:18 +03:00
committed by GitHub
parent 0630cc6f71
commit 4764cc5769

View File

@@ -83,8 +83,9 @@ static constexpr float kWindowScrollLocations[][2] = {
void WindowVisitEach(std::function<void(WindowBase*)> func)
{
for (auto& w : gWindowList)
for (size_t i = 0; i < gWindowList.size(); i++)
{
auto& w = gWindowList[i];
if (w->flags.has(WindowFlag::dead))
continue;
func(w.get());