From: cedric Date: Mon, 1 Aug 2011 14:56:26 +0000 (+0000) Subject: evas: wipe out cache in the right order. X-Git-Tag: 2.0_alpha~240^2~173 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba3297b496e043a00d9674d97d78a5c23c332c8e;p=framework%2Fuifw%2Fevas.git evas: wipe out cache in the right order. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@61956 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/cache/evas_cache_image.c b/src/lib/cache/evas_cache_image.c index 9647c2d..b11f7da 100644 --- a/src/lib/cache/evas_cache_image.c +++ b/src/lib/cache/evas_cache_image.c @@ -220,7 +220,7 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) _evas_cache_image_activ_del(ie); _evas_cache_image_lru_del(ie); _evas_cache_image_lru_nodata_del(ie); - + cache->func.destructor(ie); FREESTRC(ie->cache_key); FREESTRC(ie->file); @@ -826,9 +826,9 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file, _timestamp_build(&tstamp, &st); im = _evas_cache_image_entry_new(cache, hkey, &tstamp, file, key, lo, error); - if (!im) return NULL; + if (!im) goto on_stat_error; if (cache->func.debug) cache->func.debug("request", im); - + on_ok: *error = EVAS_LOAD_ERROR_NONE; #ifdef EVAS_FRAME_QUEUING diff --git a/src/lib/canvas/evas_object_image.c b/src/lib/canvas/evas_object_image.c index d6ecc98..520423e 100644 --- a/src/lib/canvas/evas_object_image.c +++ b/src/lib/canvas/evas_object_image.c @@ -227,7 +227,7 @@ _create_tmpf(Evas_Object *obj, void *data, int size, char *format __UNUSED__) o->tmpf_fd = fd; #ifdef __linux__ snprintf(buf, sizeof(buf), "/proc/%li/fd/%i", (long)getpid(), fd); -#endif +#endif o->tmpf = eina_stringshare_add(buf); memcpy(dst, data, size); munmap(dst, size); @@ -247,18 +247,20 @@ evas_object_image_memfile_set(Evas_Object *obj, void *data, int size, char *form MAGIC_CHECK_END(); _cleanup_tmpf(obj); evas_object_image_file_set(obj, NULL, NULL); + // invalidate the cache effectively + evas_object_image_alpha_set(obj, !o->cur.has_alpha); + evas_object_image_alpha_set(obj, !o->cur.has_alpha); + if ((size < 1) || (!data)) return; - + _create_tmpf(obj, data, size, format); evas_object_image_file_set(obj, o->tmpf, key); if (!o->engine_data) { + ERR("unable to load '%s' from memory", o->tmpf); _cleanup_tmpf(obj); return; } - // invalidate the cache effectively - evas_object_image_alpha_set(obj, !o->cur.has_alpha); - evas_object_image_alpha_set(obj, !o->cur.has_alpha); } EAPI void