From 7bdbfbf822aa3816df5615ce6180fcef171fd329 Mon Sep 17 00:00:00 2001 From: Haoyu Qiu Date: Sun, 4 Dec 2022 21:37:19 +0800 Subject: [PATCH] Fix TreeItem.remove_child not updating Tree immediately --- scene/gui/tree.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 44647596788..e40725fd94c 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -430,16 +430,16 @@ void TreeItem::remove_child(TreeItem *p_item) { *c = (*c)->next; aux->parent = nullptr; + + if (tree) { + tree->update(); + } return; } c = &(*c)->next; } - if (tree) { - tree->update(); - } - ERR_FAIL(); }