aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_main.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-12-06 10:40:11 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-12-06 10:48:17 +0900
commitaac516f352b27684b1a1aad72cf82486a3bd81de (patch)
tree695ad133aebf69047db5155b1685fd4e3aa2b249 /src/lib/evas/canvas/evas_main.c
parentevas: remove all Engine Info headers installation except for the buffer engine. (diff)
downloadefl-aac516f352b27684b1a1aad72cf82486a3bd81de.tar.gz
evas: Ensure single init of common per canvas
After @cedric's commit 6427c77707fb6116a98b we end up with E not working in Xephyr, because evas_common_shutdown() is called too many times (init_count == -1). So I'm being paranoid and tracking whether Evas has initialized or not evas_common. That way we end up with exactly the right number of inits. We even reach 0 after E shuts down :)
Diffstat (limited to 'src/lib/evas/canvas/evas_main.c')
-rw-r--r--src/lib/evas/canvas/evas_main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c
index 83f75b6e95..269d329054 100644
--- a/src/lib/evas/canvas/evas_main.c
+++ b/src/lib/evas/canvas/evas_main.c
@@ -353,7 +353,10 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
e->engine.data.context);
e->engine.func->output_free(e->engine.data.output);
e->engine.func->info_free(eo_e, e->engine.info);
-
+ }
+ if (e->common_init)
+ {
+ e->common_init = 0;
evas_common_shutdown();
}
@@ -426,9 +429,12 @@ _evas_canvas_engine_info_set(Eo *eo_e, Evas_Public_Data *e, Evas_Engine_Info *in
if (info->magic != e->engine.info_magic) return EINA_FALSE;
evas_canvas_async_block(e);
- evas_common_init();
+ if (!e->common_init)
+ {
+ e->common_init = 1;
+ evas_common_init();
+ }
res = e->engine.func->setup(eo_e, info);
- if (!res) evas_common_shutdown();
return res;
}