From 62cff663834b6c36bf304b6ec4c7a871d52f32ac Mon Sep 17 00:00:00 2001 From: HP van Braam Date: Fri, 20 Dec 2024 23:01:44 +0100 Subject: [PATCH] Don't recursively call _update_tree When a node was previously selected and the test "selected == p_node" was true the code would use set_selected() to change the selection to nullptr. However, if the tree is dirty, which is always true in this codepath, this would lead to a recursive call to _update_tree() ultimately leading to a crash due to us running out of stack. This fixes #100666 --- editor/gui/scene_tree_editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor/gui/scene_tree_editor.cpp b/editor/gui/scene_tree_editor.cpp index f826d40226a9..934bdc0beaed 100644 --- a/editor/gui/scene_tree_editor.cpp +++ b/editor/gui/scene_tree_editor.cpp @@ -369,7 +369,7 @@ void SceneTreeEditor::_update_node_subtree(Node *p_node, TreeItem *p_parent, boo item->set_selectable(0, false); item->deselect(0); if (selected == p_node) { - set_selected(nullptr, false); + selected = nullptr; } } }