Avoid potential recursion on the destruction of a collision chain.

SVN revision: 18508
This commit is contained in:
rbdpngn 2005-11-17 06:39:14 +00:00 committed by rbdpngn
parent c28f6b8d68
commit db983db6ff
1 changed files with 9 additions and 2 deletions

View File

@ -182,9 +182,16 @@ void ecore_hash_destroy(Ecore_Hash *hash)
while (i < ecore_prime_table[hash->size]) {
if (hash->buckets[i]) {
_ecore_hash_bucket_destroy(hash->buckets[i],
hash->free_key, hash->free_value);
Ecore_Hash_Node *bucket;
/*
* Remove the bucket list to avoid possible recursion
* on the free callbacks.
*/
bucket = hash->buckets[i];
hash->buckets[i] = NULL;
_ecore_hash_bucket_destroy(bucket,
hash->free_key, hash->free_value);
}
i++;
}