aboutsummaryrefslogtreecommitdiffstats
path: root/legacy/ecore/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
committerVincent Torri <vincent.torri@gmail.com>2009-10-10 05:28:43 +0000
commit4072d0b23d3c3803932c6f82ec89555b52e3b8a2 (patch)
treeee18a18b8d3d63083a276c94f0387ff5d5636185 /legacy/ecore/src/lib/ecore/ecore.c
parentadd --enable-gl-flavor-gles to force GLES flavor of GL instead of "standard" (diff)
downloadefl-4072d0b23d3c3803932c6f82ec89555b52e3b8a2.tar.gz
* check the returned value of the _init() functions
* simplify a bit the init/shutdown functions SVN revision: 42995
Diffstat (limited to 'legacy/ecore/src/lib/ecore/ecore.c')
-rw-r--r--legacy/ecore/src/lib/ecore/ecore.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/legacy/ecore/src/lib/ecore/ecore.c b/legacy/ecore/src/lib/ecore/ecore.c
index 4d8b26bec9..4c0da137ec 100644
--- a/legacy/ecore/src/lib/ecore/ecore.c
+++ b/legacy/ecore/src/lib/ecore/ecore.c
@@ -70,31 +70,39 @@ int _ecore_fps_debug = 0;
EAPI int
ecore_init(void)
{
- if (++_ecore_init_count == 1)
- {
+ if (++_ecore_init_count != 1)
+ return _ecore_init_count;
+
#ifdef HAVE_LOCALE_H
- setlocale(LC_CTYPE, "");
+ setlocale(LC_CTYPE, "");
#endif
- /*
- if (strcmp(nl_langinfo(CODESET), "UTF-8"))
- {
- printf("WARNING: not a utf8 locale!\n");
- }
- */
+ /*
+ if (strcmp(nl_langinfo(CODESET), "UTF-8"))
+ {
+ printf("WARNING: not a utf8 locale!\n");
+ }
+ */
#ifdef HAVE_EVIL
- evil_init();
+ if (!evil_init())
+ return --_ecore_init_count;
#endif
- eina_init();
- if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
- if (_ecore_fps_debug) _ecore_fps_debug_init();
- _ecore_signal_init();
- _ecore_exe_init();
- _ecore_thread_init();
- _ecore_glib_init();
- _ecore_loop_time = ecore_time_get();
- }
+ if (!eina_init())
+ goto shutdown_evil;
+ if (getenv("ECORE_FPS_DEBUG")) _ecore_fps_debug = 1;
+ if (_ecore_fps_debug) _ecore_fps_debug_init();
+ _ecore_signal_init();
+ _ecore_exe_init();
+ _ecore_thread_init();
+ _ecore_glib_init();
+ _ecore_loop_time = ecore_time_get();
return _ecore_init_count;
+
+ shutdown_evil:
+#ifdef HAVE_EVIL
+ evil_shutdown();
+#endif
+ return --_ecore_init_count;
}
/**
@@ -110,8 +118,8 @@ ecore_init(void)
EAPI int
ecore_shutdown(void)
{
- if (--_ecore_init_count)
- return _ecore_init_count;
+ if (--_ecore_init_count != 0)
+ return _ecore_init_count;
if (_ecore_fps_debug) _ecore_fps_debug_shutdown();
_ecore_poller_shutdown();