summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaulo Alcantara <pcacjr@profusion.mobi>2012-12-19 18:03:38 +0000
committerLeandro Pereira <leandro@profusion.mobi>2012-12-19 18:03:38 +0000
commit19a52f4efd4e457f5c0f13ec58dd0601ea23a17d (patch)
tree2df1cee38392d90d6dedc4dd3c32bb29782f1d01 /src
parentbb50f86bc5bb480aa5e493280dc6522c970ff833 (diff)
efl/evas: Fix XCB/Xlib crash when closing applications
We need to wait draw threads finishing their stuff before freeing canvas. Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi> SVN revision: 81395
Diffstat (limited to 'src')
-rw-r--r--src/lib/evas/canvas/evas_main.c5
-rw-r--r--src/lib/evas/canvas/evas_render.c14
-rw-r--r--src/lib/evas/include/evas_private.h1
3 files changed, 5 insertions, 15 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index db44c3ec98..e8f45ffcd2 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -152,8 +152,7 @@ evas_free(Evas *eo_e)
152 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS); 152 MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
153 return; 153 return;
154 MAGIC_CHECK_END(); 154 MAGIC_CHECK_END();
155 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS); 155 evas_sync(eo_e);
156 e->requested_free = EINA_TRUE;
157 eo_unref(eo_e); 156 eo_unref(eo_e);
158} 157}
159 158
@@ -1146,7 +1145,7 @@ static const Eo_Op_Description op_desc[] = {
1146 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER, "Force renderization of the given canvas."), 1145 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER, "Force renderization of the given canvas."),
1147 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_NORENDER, "Update the canvas internal objects but not triggering immediate."), 1146 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_NORENDER, "Update the canvas internal objects but not triggering immediate."),
1148 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_IDLE_FLUSH, "Make the canvas discard internally cached data used for rendering."), 1147 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_IDLE_FLUSH, "Make the canvas discard internally cached data used for rendering."),
1149 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SYNC, "? evas_sync"), 1148 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_SYNC, "Force evas render to be synchronized (in case it is asynchronous)."),
1150 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_DUMP, "Make the canvas discard as much data as possible used by the engine at"), 1149 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_RENDER_DUMP, "Make the canvas discard as much data as possible used by the engine at"),
1151 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_OBJECT_BOTTOM_GET, "Get the lowest (stacked) Evas object on the canvas e."), 1150 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_OBJECT_BOTTOM_GET, "Get the lowest (stacked) Evas object on the canvas e."),
1152 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_OBJECT_TOP_GET, "Get the highest (stacked) Evas object on the canvas e."), 1151 EO_OP_DESCRIPTION(EVAS_CANVAS_SUB_ID_OBJECT_TOP_GET, "Get the highest (stacked) Evas object on the canvas e."),
diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c
index a4fa3bbf83..7e814c322c 100644
--- a/src/lib/evas/canvas/evas_render.c
+++ b/src/lib/evas/canvas/evas_render.c
@@ -1823,16 +1823,6 @@ evas_render_wakeup(Evas *eo_e)
1823 Eina_List *ret_updates = NULL; 1823 Eina_List *ret_updates = NULL;
1824 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS); 1824 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
1825 1825
1826 if (e->requested_free)
1827 {
1828 EINA_LIST_FREE(e->render.updates, ru)
1829 {
1830 eina_rectangle_free(ru->area);
1831 free(ru);
1832 }
1833 goto end;
1834 }
1835
1836 EINA_LIST_FREE(e->render.updates, ru) 1826 EINA_LIST_FREE(e->render.updates, ru)
1837 { 1827 {
1838 /* punch rect out */ 1828 /* punch rect out */
@@ -2038,8 +2028,10 @@ evas_sync(Evas *eo_e)
2038} 2028}
2039 2029
2040void 2030void
2041_canvas_sync(Eo *eo_e EINA_UNUSED, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED) 2031_canvas_sync(Eo *eo_e, void *_pd EINA_UNUSED, va_list *list EINA_UNUSED)
2042{ 2032{
2033 Evas_Public_Data *e = eo_data_get(eo_e, EVAS_CLASS);
2034 evas_render_rendering_wait(e);
2043} 2035}
2044 2036
2045void 2037void
diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h
index c53601b872..876401dc42 100644
--- a/src/lib/evas/include/evas_private.h
+++ b/src/lib/evas/include/evas_private.h
@@ -421,7 +421,6 @@ struct _Evas_Public_Data
421 unsigned char focus : 1; 421 unsigned char focus : 1;
422 Eina_Bool is_frozen : 1; 422 Eina_Bool is_frozen : 1;
423 Eina_Bool rendering : 1; 423 Eina_Bool rendering : 1;
424 Eina_Bool requested_free : 1;
425 424
426 Eina_List *touch_points; 425 Eina_List *touch_points;
427 Eina_List *devices; 426 Eina_List *devices;