From 5b0ddfec3816377761a122a2eb862446bb415ba9 Mon Sep 17 00:00:00 2001 From: Jean Guyomarc'h Date: Fri, 3 Jun 2016 12:08:40 +0200 Subject: [PATCH] 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 3a8322a980..8b61d8524f 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);