diff options
-rw-r--r-- | editor/groups_editor.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/editor/groups_editor.cpp b/editor/groups_editor.cpp index bec13b710d..c4e38b327a 100644 --- a/editor/groups_editor.cpp +++ b/editor/groups_editor.cpp @@ -157,10 +157,14 @@ void GroupsEditor::_update_groups() { _load_scene_groups(scene_root_node); - for (const KeyValue<StringName, bool> &E : scene_groups) { - if (global_groups.has(E.key)) { - scene_groups.erase(E.key); + for (HashMap<StringName, bool>::Iterator E = scene_groups.begin(); E;) { + HashMap<StringName, bool>::Iterator next = E; + ++next; + + if (global_groups.has(E->key)) { + scene_groups.erase(E->key); } + E = next; } updating_groups = false; |