raster pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=9f9cfe65a664c2d6fdda33ccc2f49372e9a5bfb5

commit 9f9cfe65a664c2d6fdda33ccc2f49372e9a5bfb5
Author: Carsten Haitzler (Rasterman) <[email protected]>
Date:   Sun Aug 25 10:28:08 2019 +0100

    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.
---
 src/lib/evas/common/evas_image_scalecache.c | 6 ++++++
 1 file changed, 6 insertions(+)

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,
              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;
      }

-- 


Reply via email to