Merge pull request #61826 from guilhermefelipecgs/fix_leak

Fix ObjectDB instances leaked on state machine when editor closes
This commit is contained in:
Rémi Verschelde 2022-06-23 09:58:51 +02:00 committed by GitHub
commit 21b51fdf7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View file

@ -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();
}