When deleting an entire tree, start at head, not at root.
This commit is contained in:
parent
0714ac6c59
commit
3353ab37c2
2 changed files with 2 additions and 2 deletions
|
@ -656,7 +656,7 @@ void avl_delete_tree(avl_tree_t *tree)
|
|||
{
|
||||
avl_node_t *node, *next;
|
||||
|
||||
for(node = tree->root; node; node = next) {
|
||||
for(node = tree->head; node; node = next) {
|
||||
next = node->next;
|
||||
avl_free_node(tree, node);
|
||||
}
|
||||
|
|
|
@ -534,7 +534,7 @@ void splay_delete(splay_tree_t *tree, void *data) {
|
|||
void splay_delete_tree(splay_tree_t *tree) {
|
||||
splay_node_t *node, *next;
|
||||
|
||||
for(node = tree->root; node; node = next) {
|
||||
for(node = tree->head; node; node = next) {
|
||||
next = node->next;
|
||||
splay_free_node(tree, node);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue