aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/ecore/ecore.c
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2013-12-23 11:58:17 +0900
committerCedric BAIL <cedric.bail@samsung.com>2013-12-23 11:58:17 +0900
commit324f4aebe8f42a1b9888760765c2f06c83c95726 (patch)
treebc11e002228641aa2c59184459853dd333d06b6b /src/lib/ecore/ecore.c
parentecore: fix tests to avoid failure on successful initialization. (diff)
downloadefl-324f4aebe8f42a1b9888760765c2f06c83c95726.tar.gz
ecore: fix shutdown when using system module.
This patch will detect how many more times ecore_init was called during initialization and use that as a threshold to do a clean shutdown. It is a necessary evil as we do have ecore module that will initialize eldbus that will then reinit ecore_init from within ecore_init and without a chance for the application to act on it. I also reenable a test to make sure we will catch earlier this kind of issue.
Diffstat (limited to 'src/lib/ecore/ecore.c')
-rw-r--r--src/lib/ecore/ecore.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index d9c194c77f..58702060ee 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -58,6 +58,7 @@ Eo *_ecore_parent = NULL;
static const char *_ecore_magic_string_get(Ecore_Magic m);
static int _ecore_init_count = 0;
+static int _ecore_init_count_threshold = 0;
int _ecore_log_dom = -1;
int _ecore_fps_debug = 0;
@@ -331,6 +332,8 @@ ecore_init(void)
if (!_no_system_modules)
ecore_system_modules_load();
+ _ecore_init_count_threshold = _ecore_init_count;
+
eina_log_timing(_ecore_log_dom,
EINA_LOG_STATE_STOP,
EINA_LOG_STATE_INIT);
@@ -375,7 +378,7 @@ ecore_shutdown(void)
_ecore_unlock();
return 0;
}
- if (--_ecore_init_count != 0)
+ if (_ecore_init_count-- != _ecore_init_count_threshold)
goto unlock;
ecore_system_modules_unload();