rbtree: Fix removing last element

The refactoring of automatically updating tree->root when setting a
node's parent works very well - unless all nodes get removed and no
node's parent got updated.
This commit is contained in:
Benjamin Otte 2019-01-14 18:42:18 +01:00
parent 8a7706f2b5
commit e104337704

View File

@ -708,6 +708,11 @@ gtk_rb_tree_remove (GtkRbTree *tree,
p->right = x;
gtk_rb_node_mark_dirty (p, TRUE);
}
else
{
if (x == NULL)
tree->root = NULL;
}
/* We need to clean up the validity of the tree.
*/