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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user