forked from AuroraMiddleware/gtk
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:
parent
8a7706f2b5
commit
e104337704
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user