mirror of
https://gitlab.xiph.org/xiph/icecast-server.git
synced 2024-12-04 14:46:30 -05:00
rwlocks were not getting destroyed when avl nodes or trees were freed.
avl.h already includes thread.h svn path=/trunk/avl/; revision=4410
This commit is contained in:
parent
ea307d20f7
commit
f5059c261e
@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#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) {
|
||||
|
Loading…
Reference in New Issue
Block a user