Merge pull request #88917 from mihe/tree-selection-crash

Fix crash when selecting re-added `TreeItem::Cell`
This commit is contained in:
Rémi Verschelde 2024-02-27 21:32:53 +01:00 committed by GitHub
commit 23191b834e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -120,6 +120,10 @@ void TreeItem::_change_tree(Tree *p_tree) {
} }
if (tree->selected_item == this) { if (tree->selected_item == this) {
for (int i = 0; i < tree->selected_item->cells.size(); i++) {
tree->selected_item->cells.write[i].selected = false;
}
tree->selected_item = nullptr; tree->selected_item = nullptr;
} }