evas - gl - stop leaking images and never freeing them from cache

the subject says it all

@fix
This commit is contained in:
Carsten Haitzler 2021-03-20 21:58:25 +00:00
parent 3666574f88
commit 796e345da1
1 changed files with 11 additions and 4 deletions

View File

@ -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
{