From f937d6e7b6923e40f40a4b8900e429770484ea20 Mon Sep 17 00:00:00 2001 From: caro Date: Fri, 4 Sep 2009 05:41:20 +0000 Subject: [PATCH] evas_init() fails if eina_init() or evas_async_events_init() fail git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@42239 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/canvas/evas_async_events.c | 8 -------- src/lib/canvas/evas_main.c | 19 ++++++++++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/lib/canvas/evas_async_events.c b/src/lib/canvas/evas_async_events.c index 951002d..279a617 100644 --- a/src/lib/canvas/evas_async_events.c +++ b/src/lib/canvas/evas_async_events.c @@ -28,7 +28,6 @@ struct _Evas_Event_Async int evas_async_events_init(void) { -#ifdef BUILD_ASYNC_EVENTS int filedes[2]; _init_evas_event++; @@ -46,15 +45,11 @@ evas_async_events_init(void) fcntl(_fd_read, F_SETFL, O_NONBLOCK); return _init_evas_event; -#else - return 0; -#endif } int evas_async_events_shutdown(void) { -#ifdef BUILD_ASYNC_EVENTS _init_evas_event--; if (_init_evas_event > 0) return _init_evas_event; @@ -64,9 +59,6 @@ evas_async_events_shutdown(void) _fd_write = -1; return _init_evas_event; -#else - return 0; -#endif } EAPI int diff --git a/src/lib/canvas/evas_main.c b/src/lib/canvas/evas_main.c index 9395d38..023de8a 100644 --- a/src/lib/canvas/evas_main.c +++ b/src/lib/canvas/evas_main.c @@ -9,15 +9,26 @@ evas_init(void) { if (initcount == 0) { - eina_init(); - + if (!eina_init()) + return 0; evas_module_init(); - evas_async_events_init(); +#ifdef BUILD_ASYNC_EVENTS + if (!evas_async_events_init()) + goto shutdown_module; +#endif #ifdef EVAS_CSERVE if (getenv("EVAS_CSERVE")) evas_cserve_init(); #endif } return ++initcount; + +#ifdef BUILD_ASYNC_EVENTS + shutdown_module: + evas_module_shutdown(); + eina_shutdown(); + + return 0; +#endif } EAPI int @@ -29,7 +40,9 @@ evas_shutdown(void) #ifdef EVAS_CSERVE if (getenv("EVAS_CSERVE")) evas_cserve_shutdown(); #endif +#ifdef BUILD_ASYNC_EVENTS evas_async_events_shutdown(); +#endif evas_font_dir_cache_free(); evas_common_shutdown(); evas_module_shutdown(); -- 2.7.4