summaryrefslogtreecommitdiff
path: root/src/lib/evas/common/evas_image_scalecache.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-25 10:28:08 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-25 10:28:08 +0100
commit9f9cfe65a664c2d6fdda33ccc2f49372e9a5bfb5 (patch)
tree10da33f8337de3a624d4492a1a19f5847b0c4545 /src/lib/evas/common/evas_image_scalecache.c
parent443677c7f961032c37dc8b408db95e5655eb6b63 (diff)
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.
Diffstat (limited to '')
-rw-r--r--src/lib/evas/common/evas_image_scalecache.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/evas/common/evas_image_scalecache.c b/src/lib/evas/common/evas_image_scalecache.c
index ab390a1621..65cb9a3c21 100644
--- a/src/lib/evas/common/evas_image_scalecache.c
+++ b/src/lib/evas/common/evas_image_scalecache.c
@@ -346,12 +346,18 @@ _sci_find(RGBA_Image *im,
346 if (sci->im->cache_entry.references > 0) goto try_alloc; 346 if (sci->im->cache_entry.references > 0) goto try_alloc;
347 347
348 evas_common_rgba_image_free(&sci->im->cache_entry); 348 evas_common_rgba_image_free(&sci->im->cache_entry);
349 sci->im = NULL;
349 if (!sci->forced_unload) 350 if (!sci->forced_unload)
350 cache_size -= sci->key.dst_w * sci->key.dst_h * 4; 351 cache_size -= sci->key.dst_w * sci->key.dst_h * 4;
351 else 352 else
352 cache_size -= sci->size_adjust; 353 cache_size -= sci->size_adjust;
353// INF(" 1- %i", sci->dst_w * sci->dst_h * 4); 354// INF(" 1- %i", sci->dst_w * sci->dst_h * 4);
354 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci); 355 cache_list = eina_inlist_remove(cache_list, (Eina_Inlist *)sci);
356 if (max_scale_items < 1)
357 {
358 free(sci);
359 sci = NULL;
360 }
355 } 361 }
356 if (max_scale_items < 1) return NULL; 362 if (max_scale_items < 1) return NULL;
357 } 363 }