Fix a little memory leak when iterating.

SVN revision: 37718
This commit is contained in:
Cedric BAIL 2008-11-20 13:26:18 +00:00
parent 71f9ed1fc3
commit 9a5b397a3e
1 changed files with 2 additions and 0 deletions

View File

@ -415,6 +415,7 @@ _eina_hash_iterator_next(Eina_Iterator_Hash *it, void **data)
}
++bucket;
}
if (it->list) eina_iterator_free(it->list);
it->list = eina_rbtree_iterator_prefix(it->eh->head);
ok = eina_iterator_next(it->list, (void**) &it->el);
if (bucket == EINA_HASH_BUCKET_SIZE) ok = EINA_FALSE;
@ -439,6 +440,7 @@ static void
_eina_hash_iterator_free(Eina_Iterator_Hash *it)
{
if (it->current) eina_iterator_free(it->current);
if (it->list) eina_iterator_free(it->list);
free(it);
}