evas - scalecache - be a bit paranoid about images being set to null

this may address a bug, but i'm not sure as i can't reproduce it.
suffice to say it smells like a possible leak.
This commit is contained in:
Carsten Haitzler 2019-08-25 10:28:08 +01:00
parent 443677c7f9
commit 9f9cfe65a6
1 changed files with 6 additions and 0 deletions

View File

@ -346,12 +346,18 @@ _sci_find(RGBA_Image *im,
if (sci->im->cache_entry.references > 0) goto try_alloc;
evas_common_rgba_image_free(&sci->im->cache_entry);
sci->im = NULL;
if (!sci->forced_unload)
cache_size -= sci->key.dst_w * sci->key.dst_h * 4;
else
cache_size -= sci->size_adjust;
// INF(" 1- %i", sci->dst_w * sci->dst_h * 4);
cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
if (max_scale_items < 1)
{
free(sci);
sci = NULL;
}
}
if (max_scale_items < 1) return NULL;
}