jayji pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5b0ddfec3816377761a122a2eb862446bb415ba9

commit 5b0ddfec3816377761a122a2eb862446bb415ba9
Author: Jean Guyomarc'h <jean.guyoma...@openwide.fr>
Date:   Fri Jun 3 12:08:40 2016 +0200

    evas: fix huge memory leak for non-async rendering
    
    So... I had issues with evas-fb engine which was massively leaking,
    one image per frame.
    After investigating a bit with @cedric on IRC, the reference count
    of the cache entries was always 2 before the engine dropped.
    So, for each frame with an animation, we could never drop a cache
    entry, leading to a trumendous amount of memory leaking.
    
    Now for non-async rendering, we copy the behaviour of
    evas_render_pipe_wakeup() which is called in async-mode,
    and actually drops a reference in the cache entry.
    
    Fixes T3763
---
 src/lib/evas/canvas/evas_render.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/lib/evas/canvas/evas_render.c 
b/src/lib/evas/canvas/evas_render.c
index 3a8322a..8b61d85 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -2949,6 +2949,8 @@ evas_render_updates_internal(Evas *eo_e,
         EINA_LIST_FOREACH(e->render.updates, l, ru)
           {
              post.updated_area = eina_list_append(post.updated_area, ru->area);
+             evas_cache_image_drop(ru->surface);
+             ru->surface = NULL;
           }
         eina_spinlock_take(&(e->render.lock));
         _cb_always_call(eo_e, EVAS_CALLBACK_RENDER_POST, post.updated_area ? 
&post : NULL);

-- 


Reply via email to