kimcinoo pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8da73f9a68ae0eacade5c6d74ceeab4d7b4e91f4

commit 8da73f9a68ae0eacade5c6d74ceeab4d7b4e91f4
Author: Shinwoo Kim <cinoo....@samsung.com>
Date:   Mon Oct 14 11:07:01 2019 +0900

    evas_cache_image: drop image after replacement
    
    Summary:
    When a newly created Image_Entry works for instead of an old one,
    we need to drop it. And we did dorp it.
    
    The line calling ref and drop was added by following commit.
    
       d550190 evas image cache - add lots more locking to try stamp out
               any thread bug
    
    But it is missed by following commit.
    
       9f99ab1 evas cache: clear up caching locking and reference count.
    
    Reviewers: Hermet, raster, jsuya, cedric
    
    Reviewed By: cedric
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D10333
---
 src/lib/evas/cache/evas_cache_image.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/evas/cache/evas_cache_image.c 
b/src/lib/evas/cache/evas_cache_image.c
index 8504e1f403..9608c2188a 100644
--- a/src/lib/evas/cache/evas_cache_image.c
+++ b/src/lib/evas/cache/evas_cache_image.c
@@ -1103,6 +1103,9 @@ evas_cache_image_size_set(Image_Entry *im, unsigned int 
w, unsigned int h)
    im2->references = 1;
    im2->flags.loaded = EINA_TRUE;
    if (cache->func.debug) cache->func.debug("size_set", im2);
+   /* this drop is for handling refereces in this function */
+   evas_cache_image_drop(im);
+   /* we don't need im at this point, drop it! */
    evas_cache_image_drop(im);
    return im2;
 
@@ -1110,6 +1113,9 @@ on_error:
    SLKL(engine_lock);
    if (im2) _evas_cache_image_entry_delete(cache, im2);
    SLKU(engine_lock);
+   /* this drop is for handling refereces in this function */
+   evas_cache_image_drop(im);
+   /* we don't need im at this point, drop it! */
    evas_cache_image_drop(im);
    return NULL;
 }

-- 


Reply via email to