From a5fcaa536f011a2f1e0104e4510657ba4e4bbe0a Mon Sep 17 00:00:00 2001 From: Relintai Date: Thu, 8 Feb 2024 22:42:42 +0100 Subject: [PATCH] Fix errors during filtering Nodes in the editor. --- editor/scene_tree_editor.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp index 276ee60ead..0b649321c6 100644 --- a/editor/scene_tree_editor.cpp +++ b/editor/scene_tree_editor.cpp @@ -655,8 +655,6 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select } } } - } else { - memdelete(p_parent); } if (editor_selection) { @@ -673,6 +671,11 @@ bool SceneTreeEditor::_update_filter(TreeItem *p_parent, bool p_scroll_to_select } } + if (!(keep_for_children || keep)) { + memdelete(p_parent); + return false; + } + return keep || keep_for_children; }