Merge pull request #50492 from KoBeWi/🌳🌳🌳.x

[3.x] Update Tree when modified
This commit is contained in:
Rémi Verschelde 2021-07-15 19:03:54 +02:00 committed by GitHub
commit ba57247448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -436,6 +436,10 @@ void TreeItem::remove_child(TreeItem *p_item) {
c = &(*c)->next;
}
if (tree) {
tree->update();
}
ERR_FAIL();
}
@ -844,7 +848,9 @@ TreeItem::~TreeItem() {
clear_children();
if (parent) {
parent->remove_child(this);
parent->remove_child(this); // Also updates the Tree.
} else if (tree) {
tree->update();
}
if (tree && tree->root == this) {