From: sachiel Date: Mon, 25 Jun 2012 19:27:59 +0000 (+0000) Subject: Don't free file entries while there are still images pending from them X-Git-Tag: 2.0_alpha~46^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=692ad8c6bd1ac408e64da5ed012e09d9c871ef42;p=framework%2Fuifw%2Fevas.git Don't free file entries while there are still images pending from them git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@72826 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/bin/evas_cserve2_cache.c b/src/bin/evas_cserve2_cache.c index dcf43d8..bdc20a3 100644 --- a/src/bin/evas_cserve2_cache.c +++ b/src/bin/evas_cserve2_cache.c @@ -596,7 +596,11 @@ _image_entry_free(Image_Data *entry) } if (fentry) - fentry->images = eina_list_remove(fentry->images, entry); + { + fentry->images = eina_list_remove(fentry->images, entry); + if (!fentry->images && !fentry->base.references) + eina_hash_del_by_key(file_entries, &fentry->base.id); + } if (entry->shm) cserve2_shm_unref(entry->shm); free(entry); @@ -1069,13 +1073,10 @@ _entry_reference_del(Entry *entry, Reference *ref) if (fentry->invalid) _file_entry_free(fentry); - else - { - Image_Data *ie; - EINA_LIST_FREE(fentry->images, ie) - ie->file = NULL; - eina_hash_del_by_key(file_entries, &entry->id); - } + else if (!fentry->images) + eina_hash_del_by_key(file_entries, &entry->id); + /* don't free file entries that have images attached to it, they will + * be freed when the last unused image is freed */ } else if (entry->type == CSERVE2_IMAGE_DATA) {