summaryrefslogtreecommitdiffstats
path: root/editor/groups_editor.h
diff options
context:
space:
mode:
authorTrevor Davenport <trevor.davenport@gmail.com>2023-12-22 15:38:43 -0700
committerRémi Verschelde <rverschelde@gmail.com>2024-01-09 11:14:38 +0100
commit39ae82623d50f3135861cf762b365c2b0e278882 (patch)
treed358fe025add7df5e66824f503a9e8be3972619c /editor/groups_editor.h
parent84e205b5a17bfe7ace96b78c410ec10aa52241d2 (diff)
downloadredot-engine-39ae82623d50f3135861cf762b365c2b0e278882.tar.gz
Use ObjectID to track cached scene groups.
This prevents a crash that could occur when using the Node pointer would reference a Node which had been freed after node_removal.
Diffstat (limited to 'editor/groups_editor.h')
-rw-r--r--editor/groups_editor.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index cf74470b1b..8a0ca067de 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -78,14 +78,14 @@ class GroupsEditor : public VBoxContainer {
Button *add = nullptr;
Tree *tree = nullptr;
- HashMap<Node *, HashMap<StringName, bool>> scene_groups_cache;
+ HashMap<ObjectID, HashMap<StringName, bool>> scene_groups_cache;
HashMap<StringName, bool> scene_groups_for_caching;
HashMap<StringName, bool> scene_groups;
HashMap<StringName, String> global_groups;
- void _update_scene_groups(Node *p_node);
- void _cache_scene_groups(Node *p_node);
+ void _update_scene_groups(const ObjectID &p_id);
+ void _cache_scene_groups(const ObjectID &p_id);
void _show_add_group_dialog();
void _show_rename_group_dialog();