mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Reimplemented scene editor window caching to fix crash when closing one during iteration
This commit is contained in:
@@ -2787,8 +2787,9 @@ namespace Nuake {
|
||||
SceneEditorDockspaceNodeID = ImGui::DockBuilderAddNode(dockspaceId, ImGuiDockNodeFlags_DockSpace);
|
||||
}
|
||||
|
||||
// We need to cache, because we might delete one while iterating
|
||||
for (auto& sceneEditor : sceneEditors)
|
||||
// We need to make a copy, because we might delete one while iterating
|
||||
std::vector<Ref<SceneEditorWindow>> cachedEditors = sceneEditors;
|
||||
for (auto& sceneEditor : cachedEditors)
|
||||
{
|
||||
sceneEditor->Draw();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user