eina_hash: Move hash_free_cb to avoid memory leak.

Call hash_free_cb after finish deletion.

ref T8530

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10918
This commit is contained in:
Woochanlee 2019-12-19 09:43:36 +00:00 committed by Cedric BAIL
parent 3a385ccae0
commit a2084ba22e
1 changed files with 2 additions and 1 deletions

View File

@ -410,7 +410,6 @@ _eina_hash_del_by_hash_el(Eina_Hash *hash,
hash_element), EINA_RBTREE_CMP_NODE_CB(
_eina_hash_key_rbtree_cmp_node),
(const void *)hash->key_cmp_cb);
_eina_hash_el_free(hash_element, hash);
if (!hash_head->head)
{
@ -431,6 +430,8 @@ _eina_hash_del_by_hash_el(Eina_Hash *hash,
hash->buckets = NULL;
}
_eina_hash_el_free(hash_element, hash);
return EINA_TRUE;
}