summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-04 12:26:16 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-07-04 12:26:16 +0900
commit1eaf26989b51ac6af8fbbb2928842e5f783e7846 (patch)
treed294d36122727ec126bab49c55d32d3ef960af1c
parent84451db6389efb46cb753d8d721144fc76af7d11 (diff)
downloadefl-1eaf26989b51ac6af8fbbb2928842e5f783e7846.tar.gz
evas - gl common - fix drop of image on cache hit in gl engine images
@fix - this fixes a leak (reference count leak)
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/modules/evas/engines/gl_common/evas_gl_image.c b/src/modules/evas/engines/gl_common/evas_gl_image.c
index 0a6d8c98e7..4f95a93773 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -168,21 +168,19 @@ _evas_gl_common_image(Evas_Engine_GL_Context *gc, RGBA_Image *im_im,
return NULL;
}
*/
-
+
// FIXME: keep unreffed shared images around
EINA_LIST_FOREACH(gc->shared->images, l, im)
{
- if (im->im == im_im)
- {
-// why did i put this here? i think to free the rgba pixel data once a texture
-// exists.
-// evas_cache_image_drop(&(im_im->cache_entry));
- gc->shared->images = eina_list_remove_list(gc->shared->images, l);
- gc->shared->images = eina_list_prepend(gc->shared->images, im);
+ if (im->im == im_im)
+ {
+ evas_cache_image_drop(&(im_im->cache_entry));
+ gc->shared->images = eina_list_remove_list(gc->shared->images, l);
+ gc->shared->images = eina_list_prepend(gc->shared->images, im);
evas_gl_common_image_ref(im);
- *error = EVAS_LOAD_ERROR_NONE;
- return im;
- }
+ *error = EVAS_LOAD_ERROR_NONE;
+ return im;
+ }
}
im = calloc(1, sizeof(Evas_GL_Image));
@@ -194,8 +192,8 @@ _evas_gl_common_image(Evas_Engine_GL_Context *gc, RGBA_Image *im_im,
else
#endif
evas_cache_image_drop(&(im_im->cache_entry));
- *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
- return NULL;
+ *error = EVAS_LOAD_ERROR_RESOURCE_ALLOCATION_FAILED;
+ return NULL;
}
if (im_im->cache_entry.cspaces)
{