fix corner case with edje - where u check for existens of parts in a edje but

never use a single object from it.



SVN revision: 40410
This commit is contained in:
Carsten Haitzler 2009-04-27 02:41:33 +00:00
parent f783e3900d
commit 95ea5ee0e1
1 changed files with 8 additions and 3 deletions

View File

@ -222,11 +222,11 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
return edf;
}
if (!coll) return edf;
if (!edf->collection_hash)
edf->collection_hash = eina_hash_string_small_new(NULL);
if (!coll) return edf;
edc = eina_hash_find(edf->collection_hash, coll);
if (edc)
{
@ -321,6 +321,11 @@ _edje_cache_file_coll_open(const char *file, const char *coll, int *error_ret, E
}
if (edc_ret) *edc_ret = edc;
if (eina_hash_population(edf->collection_hash) == 0)
{
eina_hash_free(edf->collection_hash);
edf->collection_hash = NULL;
}
return edf;
}
@ -360,7 +365,7 @@ _edje_cache_coll_unref(Edje_File *edf, Edje_Part_Collection *edc)
edc->references--;
if (edc->references != 0) return;
eina_hash_del(edf->collection_hash, edc->part, edc);
if (!eina_hash_population(edf->collection_hash))
if (eina_hash_population(edf->collection_hash) == 0)
{
eina_hash_free(edf->collection_hash);
edf->collection_hash = NULL;