diff --git a/src/hash.c b/src/hash.c index 039ee94..4bcfe2c 100644 --- a/src/hash.c +++ b/src/hash.c @@ -36,14 +36,14 @@ main(int argc, char * argv[]) deleted = hashDelete(hash, CSTRA("f9e0g")); delete(deleted); - //deleted = hashDelete(hash, CSTRA("fcrne9")); - //delete(deleted); - //deleted = hashDelete(hash, CSTRA("fr09ie")); - //delete(deleted); - //deleted = hashDelete(hash, CSTRA("jfde9w8")); - //delete(deleted); - //deleted = hashDelete(hash, CSTRA("j8frheff")); - //delete(deleted); + deleted = hashDelete(hash, CSTRA("fcrne9")); + delete(deleted); + deleted = hashDelete(hash, CSTRA("fr09ie")); + delete(deleted); + deleted = hashDelete(hash, CSTRA("jfde9w8")); + delete(deleted); + deleted = hashDelete(hash, CSTRA("j8frheff")); + delete(deleted); delete(hash); memCleanup(); diff --git a/src/tree/destroy.c b/src/tree/destroy.c index 8a6015e..a60d87a 100644 --- a/src/tree/destroy.c +++ b/src/tree/destroy.c @@ -39,8 +39,9 @@ treeDestroy(Tree * this, TreeAction action) * If we come from the right so nothing and go to our * next parent. */ - if ((NULL == TREE_LEFT(node) && NULL == TREE_RIGHT(node)) - || previous == TREE_RIGHT(node)) { + if (((NULL == TREE_LEFT(node) || previous == TREE_LEFT(node)) + && NULL == TREE_RIGHT(node)) + || previous == TREE_RIGHT(node)) { Tree parent = TREE_PARENT(node); diff --git a/src/utils/memory.c b/src/utils/memory.c index ea1cd29..6c6610e 100644 --- a/src/utils/memory.c +++ b/src/utils/memory.c @@ -683,7 +683,8 @@ post(struct memSegment * tree, void (*cb)(struct memSegment *, int)) * If we come from the right so nothing and go to our * next parent. */ - if ((NULL == node->left && NULL == node->right) + if (((NULL == node->left || previous == node->left) + && NULL == node->right) || previous == node->right) { struct memSegment * parent = node->parent;