Fix crash when window gets removed during windows update loop

This commit is contained in:
Wojtek Figat
2023-10-22 15:56:25 +02:00
parent 1280e61af0
commit c88e184df3
2 changed files with 9 additions and 4 deletions

View File

@@ -513,7 +513,9 @@ DEFINE_INTERNAL_CALL(void) EditorInternal_RunVisualScriptBreakpointLoopTick(floa
WindowsManager::WindowsLocker.Unlock();
}
WindowsManager::WindowsLocker.Lock();
for (auto& win : WindowsManager::Windows)
Array<Window*, InlinedAllocation<32>> windows;
windows.Add(WindowsManager::Windows);
for (Window* win : windows)
{
if (win->IsVisible())
win->OnUpdate(deltaTime);