From f5059c261e98b5f8e9076607784e01724ca06b39 Mon Sep 17 00:00:00 2001 From: brendan Date: Thu, 6 Mar 2003 00:59:41 +0000 Subject: [PATCH] rwlocks were not getting destroyed when avl nodes or trees were freed. avl.h already includes thread.h svn path=/trunk/avl/; revision=4410 --- src/avl/avl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/avl/avl.c b/src/avl/avl.c index 6e6c0021..1a8ed630 100644 --- a/src/avl/avl.c +++ b/src/avl/avl.c @@ -22,7 +22,7 @@ * */ -/* $Id: avl.c,v 1.1 2001/09/10 02:28:03 jack Exp $ */ +/* $Id: avl.c,v 1.2 2003/03/06 00:59:41 brendan Exp $ */ /* * This is a fairly straightfoward translation of a prototype @@ -32,10 +32,8 @@ #include #include -#include "thread.h" #include "avl.h" - avl_node * avl_node_new (void * key, avl_node * parent) @@ -103,6 +101,7 @@ avl_tree_free (avl_tree * tree, avl_free_key_fun_type free_key_fun) if (tree->root) { free (tree->root); } + thread_rwlock_destroy(&tree->rwlock); free (tree); } @@ -442,6 +441,7 @@ int avl_delete(avl_tree *tree, void *key, avl_free_key_fun_type free_key_fun) /* return the key and node to storage */ free_key_fun (x->key); + thread_rwlock_destroy (&x->rwlock); free (x); while (shorter && p->parent) {