diff options
author | Trevor Davenport <trevor.davenport@gmail.com> | 2023-12-22 15:38:43 -0700 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-01-09 11:14:38 +0100 |
commit | 39ae82623d50f3135861cf762b365c2b0e278882 (patch) | |
tree | d358fe025add7df5e66824f503a9e8be3972619c /editor/groups_editor.h | |
parent | 84e205b5a17bfe7ace96b78c410ec10aa52241d2 (diff) | |
download | redot-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.h | 6 |
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(); |