As cache_key uses evas_stringshare, it should be const.

Don't free stringshare'd strings.
Formatting.


SVN revision: 31291
This commit is contained in:
Sebastian Dransfeld 2007-08-13 05:30:17 +00:00
parent 07c37865cf
commit 8ef049c3da
3 changed files with 88 additions and 84 deletions

View File

@ -396,7 +396,7 @@ evas_cache_engine_image_size_set(RGBA_Engine_Image *eim, int w, int h)
}
else
{
char* cache_key = NULL;
const char *cache_key = NULL;
cache_key = eim->cache_key ? evas_stringshare_add(eim->cache_key) : NULL;
new->cache_key = cache_key;

View File

@ -62,8 +62,11 @@ _evas_cache_image_free_cb(Evas_Hash *hash, const char *key, void *data, void *fd
if (cache->func.debug)
cache->func.debug("shutdown-activ", im);
free(im->cache_key);
if (im->cache_key)
{
evas_stringshare_del(im->cache_key);
im->cache_key = NULL;
}
cache->func.destructor(im);
evas_common_image_delete(im);
@ -86,8 +89,11 @@ evas_cache_image_shutdown(Evas_Cache_Image *cache)
im = (RGBA_Image *) cache->lru;
cache->lru = evas_object_list_remove(cache->lru, im);
free(im->cache_key);
if (im->cache_key)
{
evas_stringshare_del(im->cache_key);
im->cache_key = NULL;
}
if (cache->func.debug)
cache->func.debug("shutdown-lru", im);
@ -347,7 +353,6 @@ evas_cache_image_alone(RGBA_Image *im)
{
RGBA_Image *im_dirty = im;
Evas_Cache_Image *cache;
char* hkey;
assert(im);
assert(im->cache);
@ -534,7 +539,6 @@ EAPI void
evas_cache_image_load_data(RGBA_Image *im)
{
Evas_Cache_Image *cache;
int size;
assert(im);
assert(im->image);

View File

@ -410,7 +410,7 @@ struct _RGBA_Image
/* Cache stuff. */
Evas_Cache_Image *cache;
char *cache_key;
const char *cache_key;
};
struct _RGBA_Engine_Image