fix memory leak of dirty image

if file was chaned by somebody, it was added to dirty list during cache request.
currently this dirty image added to cache->dirty list and never freed until image shutdown.
but dirty image of chaned file never used so add delete code for memory efficiency.
and fix bad indentation.


SVN revision: 67604
This commit is contained in:
Jiyoun Park 2012-01-30 14:36:15 +00:00
parent 4f4a904816
commit 64e2d7fee5
1 changed files with 168 additions and 164 deletions

View File

@ -780,6 +780,8 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
* of an image at a given key. we wither find it and keep re-reffing
* it or we dirty it and get it out */
_evas_cache_image_dirty_add(im);
/* this image never used, so it have to be deleted */
_evas_cache_image_entry_delete(cache, im);
im = NULL;
}
@ -816,6 +818,8 @@ evas_cache_image_request(Evas_Cache_Image *cache, const char *file,
}
/* as avtive cache find - if we match in lru and its invalid, dirty */
_evas_cache_image_dirty_add(im);
/* this image never used, so it have to be deleted */
_evas_cache_image_entry_delete(cache, im);
im = NULL;
}
if (stat_failed) goto on_stat_error;