Destroy hashtable if either keyDestroyFunc or valDestroyFunc exists

This commit is contained in:
Hugo 2019-01-05 20:19:47 +02:00
parent 63efe3cb29
commit 49171828bb

View File

@ -314,7 +314,7 @@ void hashtable_free(HashTable *h) {
uint32_t i;
if (h->table) {
if (h->keyDestroyFunc || h->keyDestroyFunc) {
if (h->keyDestroyFunc || h->valDestroyFunc) {
hashtable_foreach(h,_hashtable_destroy,NULL);
}
for (i=0;i<h->length;i++) {