summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorGuilherme Felipe de C. G. da Silva <guilhermefelipecgs@gmail.com>2022-06-07 23:06:45 -0300
committerGuilherme Felipe de C. G. da Silva <guilhermefelipecgs@gmail.com>2022-06-08 17:08:48 -0300
commit7fc3aa43ce39d8d12e57ec0585a9aed716f1ec24 (patch)
tree205f4cf03122412a1f0d1bc7d86a04582eae789f /editor/plugins
parent3f8d86b076bb7a15b1f5b34dc709090f6d3e3bc3 (diff)
Fix ObjectDB instances leaked on state machine when editor closes
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/animation_state_machine_editor.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/animation_state_machine_editor.cpp b/editor/plugins/animation_state_machine_editor.cpp
index ece0c6a0ce..b2c5450aaa 100644
--- a/editor/plugins/animation_state_machine_editor.cpp
+++ b/editor/plugins/animation_state_machine_editor.cpp
@@ -817,11 +817,11 @@ bool AnimationNodeStateMachineEditor::_create_submenu(PopupMenu *p_menu, Ref<Ani
Vector<Ref<AnimationNodeStateMachine>> parents = p_parents;
if (from_root) {
- Ref<AnimationNodeStateMachine> prev = p_nodesm->get_prev_state_machine();
+ AnimationNodeStateMachine *prev = p_nodesm->get_prev_state_machine();
- while (prev.is_valid()) {
+ while (prev != nullptr) {
parents.push_back(prev);
- p_nodesm = prev;
+ p_nodesm = Ref<AnimationNodeStateMachine>(prev);
prev_path += "../";
prev = prev->get_prev_state_machine();
}