summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2015-10-07 18:08:56 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2015-10-07 18:11:07 +0900
commit42beea0ca57594759bd526afd4db62906728b1e7 (patch)
tree077e1781d384042c3e196bf83316bba8dc23ad14
parent434572355c7e929b84210b2f795634d38f13c913 (diff)
Evas filters: Fix crash with async sw rendering
If the filtered object (text or image object) was deleted, its output image (cached inside the filter data) would be freed immediately. This could cause crashes in case of async rendering. @fix
-rw-r--r--src/lib/evas/canvas/evas_filter_mixin.c8
-rw-r--r--src/lib/evas/include/evas_private.h1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/evas/canvas/evas_filter_mixin.c b/src/lib/evas/canvas/evas_filter_mixin.c
index 934a8c6fb9..154c6dc0f3 100644
--- a/src/lib/evas/canvas/evas_filter_mixin.c
+++ b/src/lib/evas/canvas/evas_filter_mixin.c
@@ -254,6 +254,7 @@ evas_filter_object_render(Eo *eo_obj, Evas_Object_Protected_Data *obj,
254 fcow = FCOW_BEGIN(pd); 254 fcow = FCOW_BEGIN(pd);
255 fcow->output = filter_output; 255 fcow->output = filter_output;
256 fcow->changed = EINA_FALSE; 256 fcow->changed = EINA_FALSE;
257 fcow->async = do_async;
257 if (!ok) fcow->invalid = EINA_TRUE; 258 if (!ok) fcow->invalid = EINA_TRUE;
258 FCOW_END(fcow, pd); 259 FCOW_END(fcow, pd);
259 260
@@ -518,7 +519,12 @@ _evas_filter_destructor(Eo *eo_obj, Evas_Filter_Data *pd)
518 if (evas_object_filter_cow_default == pd->data) return; 519 if (evas_object_filter_cow_default == pd->data) return;
519 520
520 if (pd->data->output) 521 if (pd->data->output)
521 ENFN->image_free(ENDT, pd->data->output); 522 {
523 if (!pd->data->async)
524 ENFN->image_free(ENDT, pd->data->output);
525 else
526 evas_unref_queue_image_put(obj->layer->evas, pd->data->output);
527 }
522 eina_hash_free(pd->data->sources); 528 eina_hash_free(pd->data->sources);
523 EINA_INLIST_FOREACH_SAFE(pd->data->data, il, db) 529 EINA_INLIST_FOREACH_SAFE(pd->data->data, il, db)
524 { 530 {
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index 01b43401a5..730eae3f65 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -1194,6 +1194,7 @@ struct _Evas_Object_Filter_Data
1194 } state; 1194 } state;
1195 Eina_Bool changed : 1; 1195 Eina_Bool changed : 1;
1196 Eina_Bool invalid : 1; // Code parse failed 1196 Eina_Bool invalid : 1; // Code parse failed
1197 Eina_Bool async : 1;
1197}; 1198};
1198 1199
1199struct _Evas_Object_Func 1200struct _Evas_Object_Func