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.
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;
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);
_ecore_unlock();
return 0;
}
- if (--_ecore_init_count != 0)
+ if (_ecore_init_count-- != _ecore_init_count_threshold)
goto unlock;
ecore_system_modules_unload();
fail_if(ret < 1);
ret = ecore_shutdown();
+ fail_if(ret != 0);
}
END_TEST