jpeg pushed a commit to branch efl-1.19. http://git.enlightenment.org/core/efl.git/commit/?id=2b90533e37f2e3c746589155b91648b18d516d32
commit 2b90533e37f2e3c746589155b91648b18d516d32 Author: Jean-Philippe Andre <[email protected]> Date: Thu Apr 13 17:57:47 2017 +0900 evas filters: Prevent crash with async sw rendering --- src/lib/evas/canvas/evas_filter_mixin.c | 13 ++++++++----- src/lib/evas/filters/evas_filter.c | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c index b19e4e6..b2aeadb 100644 --- a/src/lib/evas/canvas/evas_filter_mixin.c +++ b/src/lib/evas/canvas/evas_filter_mixin.c @@ -64,6 +64,7 @@ _filter_end_sync(Evas_Filter_Context *ctx, Evas_Object_Protected_Data *obj, // Destroy context as we won't reuse it. evas_filter_buffer_backing_release(ctx, previous); evas_filter_context_destroy(ctx); + efl_unref(eo_obj); } static void @@ -87,12 +88,8 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool success) Evas_Object_Protected_Data *obj; Evas_Filter_Data *pd = data; -#ifdef DEBUG - EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is()); -#endif - obj = pd->data->obj; - EINA_SAFETY_ON_FALSE_RETURN(obj && obj->layer && obj->layer->evas); + EVAS_OBJECT_DATA_VALID_CHECK(obj); if (!pd->data->async) { @@ -100,6 +97,10 @@ _filter_cb(Evas_Filter_Context *ctx, void *data, Eina_Bool success) return; } +#ifdef DEBUG + EINA_SAFETY_ON_FALSE_RETURN(!eina_main_loop_is()); +#endif + post_data = calloc(1, sizeof(*post_data)); post_data->success = success; post_data->ctx = ctx; @@ -315,6 +316,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, ENFN->context_free(ENDT, drawctx); // Add post-run callback and run filter + efl_ref(eo_obj); evas_filter_context_post_run_callback_set(filter, _filter_cb, pd); ok = evas_filter_run(filter); @@ -332,6 +334,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj, else { ERR("Rendering failed."); + efl_unref(eo_obj); return EINA_FALSE; } } diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index 9438a4e..98700cd 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -1609,7 +1609,7 @@ evas_filter_run(Evas_Filter_Context *ctx) EINA_SAFETY_ON_NULL_RETURN_VAL(ctx, EINA_FALSE); if (!ctx->commands) - return EINA_TRUE; + return EINA_FALSE; if (ENFN->gl_surface_read_pixels && !warned) { @@ -1627,7 +1627,8 @@ evas_filter_run(Evas_Filter_Context *ctx) if (ctx->post_run.cb) ctx->post_run.cb(ctx, ctx->post_run.data, ret); - return ret; + + return EINA_TRUE; } --
