From 95ea5ee0e14ed6e4515b7fa05e21ce2c7bcdca72 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 27 Apr 2009 02:41:33 +0000 Subject: [PATCH] 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 --- legacy/edje/src/lib/edje_cache.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/legacy/edje/src/lib/edje_cache.c b/legacy/edje/src/lib/edje_cache.c index f74abf8ceb..ed6ddb32d1 100644 --- a/legacy/edje/src/lib/edje_cache.c +++ b/legacy/edje/src/lib/edje_cache.c @@ -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;