Commit 0b485ec79869602c445e983ca6214e45c7ebffb4
1 parent
dba76798
now its possible to say a hash that it should not free its members on cleanup...…
… useful if several structures hold the members
Showing
2 changed files
with
6 additions
and
1 deletions
@@ -35,7 +35,11 @@ tDelete(const void * node, const void * data, const int depth) | @@ -35,7 +35,11 @@ tDelete(const void * node, const void * data, const int depth) | ||
35 | void | 35 | void |
36 | TR_hashCleanup(TR_Hash this) | 36 | TR_hashCleanup(TR_Hash this) |
37 | { | 37 | { |
38 | - TR_treeDestroy(&(this->root), tDelete); | 38 | + if (this->cleanup_no_free) { |
39 | + TR_treeDestroy(&(this->root), NULL); | ||
40 | + } else { | ||
41 | + TR_treeDestroy(&(this->root), tDelete); | ||
42 | + } | ||
39 | } | 43 | } |
40 | 44 | ||
41 | // vim: set ts=4 sw=4: | 45 | // vim: set ts=4 sw=4: |
Please
register
or
login
to post a comment