summaryrefslogtreecommitdiff
path: root/src/modules/evas
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-20 21:58:25 +0000
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2021-03-20 21:58:25 +0000
commit796e345da1fd8e27c6ada3dd81cacb5f9b4f4aa9 (patch)
tree16e331c24b3c304e84517ae809a50dc3a318859d /src/modules/evas
parent3666574f881a9801fe5af675de0e3bb3cb8afc54 (diff)
downloadefl-796e345da1fd8e27c6ada3dd81cacb5f9b4f4aa9.tar.gz
evas - gl - stop leaking images and never freeing them from cache
the subject says it all @fix
Diffstat (limited to 'src/modules/evas')
-rw-r--r--src/modules/evas/engines/gl_common/evas_gl_image.c15
1 files changed, 11 insertions, 4 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 7d05cab15d..3a75852ed0 100644
--- a/src/modules/evas/engines/gl_common/evas_gl_image.c
+++ b/src/modules/evas/engines/gl_common/evas_gl_image.c
@@ -69,10 +69,17 @@ _evas_gl_image_cache_add(Evas_GL_Image *im)
{
if (im->references == 0)
{
- im->csize = im->w * im->h * 4;
- im->gc->shared->images_size += im->csize;
- _evas_gl_image_cache_trim(im->gc);
- return EINA_TRUE;
+ if (im->cached)
+ {
+ im->csize = im->w * im->h * 4;
+ im->gc->shared->images_size += im->csize;
+ _evas_gl_image_cache_trim(im->gc);
+ if (!eina_list_data_find(im->gc->shared->images, im))
+ { // FIXME for a messed up caching system... this used to be simple
+ im->gc->shared->images = eina_list_prepend(im->gc->shared->images, im);
+ }
+ return EINA_TRUE;
+ }
}
else
{