Enlightenment CVS committal
Author : cedric
Project : e17
Module : libs/evas
Dir : e17/libs/evas/src/lib/cache
Modified Files:
evas_cache_image.c
Log Message:
Fix a bug when a file change when it's still in use. Thanks to Adriano Rezende
for helping tracking the bug.
===================================================================
RCS file: /cvs/e/e17/libs/evas/src/lib/cache/evas_cache_image.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- evas_cache_image.c 6 May 2008 11:20:29 -0000 1.16
+++ evas_cache_image.c 9 May 2008 16:18:18 -0000 1.17
@@ -53,13 +53,20 @@
Image_Entry *im,
const char *key)
{
- im->flags.activ = 0;
- im->flags.dirty = 0;
- im->flags.cached = 1;
- cache->inactiv = evas_hash_direct_add(cache->inactiv, key, im);
- cache->lru = evas_object_list_prepend(cache->lru, im);
- cache->usage += cache->func.mem_size_get(im);
-}
+ if (im->cache_key)
+ {
+ im->flags.activ = 0;
+ im->flags.dirty = 0;
+ im->flags.cached = 1;
+ cache->inactiv = evas_hash_direct_add(cache->inactiv, key, im);
+ cache->lru = evas_object_list_prepend(cache->lru, im);
+ cache->usage += cache->func.mem_size_get(im);
+ }
+ else
+ {
+ _evas_cache_image_entry_delete(cache, im);
+ }
+ }
static void
_evas_cache_image_remove_lru_nodata(Evas_Cache_Image *cache,
@@ -381,6 +388,9 @@
if (st.st_mtime != im->timestamp) ok = 0;
}
if (ok) goto on_ok;
+
+ _evas_cache_image_remove_activ(cache, im);
+ _evas_cache_image_make_dirty(cache, im);
}
im = evas_hash_find(cache->inactiv, hkey);
@@ -452,16 +462,16 @@
im->references--;
cache = im->cache;
- if (im->flags.dirty)
- {
- _evas_cache_image_entry_delete(cache, im);
- return ;
- }
-
if (im->references == 0)
{
+ if (im->flags.dirty)
+ {
+ _evas_cache_image_entry_delete(cache, im);
+ return ;
+ }
+
_evas_cache_image_remove_activ(cache, im);
- _evas_cache_image_make_inactiv(cache, im, im->cache_key);
+ _evas_cache_image_make_inactiv(cache, im, im->cache_key);
evas_cache_image_flush(cache);
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs