From 7fc3aa43ce39d8d12e57ec0585a9aed716f1ec24 Mon Sep 17 00:00:00 2001 From: "Guilherme Felipe de C. G. da Silva" Date: Tue, 7 Jun 2022 23:06:45 -0300 Subject: Fix ObjectDB instances leaked on state machine when editor closes --- editor/plugins/animation_state_machine_editor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'editor/plugins') 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> parents = p_parents; if (from_root) { - Ref 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(prev); prev_path += "../"; prev = prev->get_prev_state_machine(); } -- cgit v1.2.3