allow init to be called multiple times.

SVN revision: 47498
This commit is contained in:
Gustavo Sverzut Barbieri 2010-03-27 01:24:21 +00:00
parent 86bf257913
commit 64bc9152d5
1 changed files with 5 additions and 0 deletions

View File

@ -273,6 +273,7 @@ int _elm_log_dom = -1;
EAPI int ELM_EVENT_POLICY_CHANGED = 0;
static int _elm_init_count = 0;
static int _elm_policies[ELM_POLICY_LAST];
static Ecore_Event_Handler *_elm_exit_handler = NULL;
static Ecore_Event_Handler *_elm_event_property_change = NULL;
@ -367,6 +368,8 @@ _elm_rescale(void)
EAPI void
elm_init(int argc, char **argv)
{
_elm_init_count++;
if (_elm_init_count != 1) return;
elm_quicklaunch_init(argc, argv);
elm_quicklaunch_sub_init(argc, argv);
}
@ -383,6 +386,8 @@ elm_init(int argc, char **argv)
EAPI void
elm_shutdown(void)
{
_elm_init_count--;
if (_elm_init_count != 0) return;
elm_quicklaunch_sub_shutdown();
elm_quicklaunch_shutdown();
}