jpeg pushed a commit to branch efl-1.9.

http://git.enlightenment.org/core/efl.git/commit/?id=528489c31ce0842f783270c172f8edaf831d336b

commit 528489c31ce0842f783270c172f8edaf831d336b
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Wed Mar 12 14:06:23 2014 +0900

    Evas filters: Fix memory leak when destroying the object
    
    The GL buffers set to be freed were released only the async case...
    which doesn't make sense since GL is sync.
    
    @fix
    
    Conflicts:
        src/lib/evas/filters/evas_filter.c
---
 src/lib/evas/filters/evas_filter.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/src/lib/evas/filters/evas_filter.c 
b/src/lib/evas/filters/evas_filter.c
index 0a48869..20e701e 100644
--- a/src/lib/evas/filters/evas_filter.c
+++ b/src/lib/evas/filters/evas_filter.c
@@ -1694,7 +1694,8 @@ static Eina_Bool
 _filter_chain_run(Evas_Filter_Context *ctx)
 {
    Evas_Filter_Command *cmd;
-   Eina_Bool ok = EINA_TRUE;
+   Eina_Bool ok = EINA_FALSE;
+   void *buffer;
 
    ctx->running = EINA_TRUE;
    EINA_INLIST_FOREACH(ctx->commands, cmd)
@@ -1711,6 +1712,13 @@ _filter_chain_run(Evas_Filter_Context *ctx)
 
 end:
    ctx->running = EINA_FALSE;
+
+   EINA_LIST_FREE(ctx->post_run.buffers_to_free, buffer)
+     {
+        if (ctx->gl_engine)
+          ENFN->image_free(ENDT, buffer);
+     }
+
    return ok;
 }
 
@@ -1718,17 +1726,10 @@ static void
 _filter_thread_run_cb(void *data)
 {
    Evas_Filter_Context *ctx = data;
-   void *buffer;
 
    // TODO: Add return value check and call error cb
    _filter_chain_run(ctx);
 
-   EINA_LIST_FREE(ctx->post_run.buffers_to_free, buffer)
-     {
-        if (ctx->gl_engine)
-          ENFN->image_free(ENDT, buffer);
-     }
-
    if (ctx->post_run.cb)
      ctx->post_run.cb(ctx, ctx->post_run.data);
 }
@@ -1753,6 +1754,7 @@ evas_filter_run(Evas_Filter_Context *ctx)
      }
 
    ret = _filter_chain_run(ctx);
+
    if (ctx->post_run.cb)
      ctx->post_run.cb(ctx, ctx->post_run.data);
    return ret;

-- 


Reply via email to