From 3353ab37c2d6fb3652fbf7a85d85997be1c0c1b5 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Sat, 11 Nov 2006 22:45:45 +0000 Subject: [PATCH] When deleting an entire tree, start at head, not at root. --- lib/avl_tree.c | 2 +- lib/splay_tree.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/avl_tree.c b/lib/avl_tree.c index 27d5eec..3bfdfee 100644 --- a/lib/avl_tree.c +++ b/lib/avl_tree.c @@ -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); } diff --git a/lib/splay_tree.c b/lib/splay_tree.c index f6e5a4b..62e9e31 100644 --- a/lib/splay_tree.c +++ b/lib/splay_tree.c @@ -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); } -- 2.25.1