When deleting an entire tree, start at head, not at root.

This commit is contained in:
Guus Sliepen 2006-11-11 22:45:45 +00:00
parent 0714ac6c59
commit 3353ab37c2
2 changed files with 2 additions and 2 deletions

View file

@ -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);
}

View file

@ -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);
}