- guard the efreet_icon init/shutdown methods as efreet_mime is calling it

internally


SVN revision: 30904
This commit is contained in:
Dan Sinclair 2007-07-19 14:54:51 +00:00 committed by Dan Sinclair
parent 9ea393d8a0
commit 71da5f4639
1 changed files with 14 additions and 1 deletions

View File

@ -11,6 +11,8 @@ static Ecore_Hash *efreet_icon_themes = NULL;
Ecore_List *efreet_icon_extensions = NULL; Ecore_List *efreet_icon_extensions = NULL;
static Ecore_List *efreet_extra_icon_dirs = NULL; static Ecore_List *efreet_extra_icon_dirs = NULL;
static int efreet_icon_init_count = 0;
static char *efreet_icon_remove_extension(const char *icon); static char *efreet_icon_remove_extension(const char *icon);
static Efreet_Icon_Theme *efreet_icon_find_theme_check(const char *theme_name); static Efreet_Icon_Theme *efreet_icon_find_theme_check(const char *theme_name);
@ -89,12 +91,19 @@ static int efreet_icon_theme_cache_check_dir(Efreet_Icon_Theme *theme,
int int
efreet_icon_init(void) efreet_icon_init(void)
{ {
if (efreet_icon_init_count++ > 0)
return efreet_icon_init_count;
if (!efreet_icon_themes) if (!efreet_icon_themes)
{ {
const char *default_exts[] = {".png", ".xpm", NULL}; const char *default_exts[] = {".png", ".xpm", NULL};
int i; int i;
if (!ecore_init()) return 0; if (!ecore_init())
{
efreet_icon_init_count--;
return 0;
}
/* setup the default extension list */ /* setup the default extension list */
efreet_icon_extensions = ecore_list_new(); efreet_icon_extensions = ecore_list_new();
@ -120,6 +129,9 @@ efreet_icon_init(void)
void void
efreet_icon_shutdown(void) efreet_icon_shutdown(void)
{ {
if (--efreet_icon_init_count)
return;
IF_FREE(efreet_icon_user_dir); IF_FREE(efreet_icon_user_dir);
IF_FREE(efreet_icon_deprecated_user_dir); IF_FREE(efreet_icon_deprecated_user_dir);
@ -129,6 +141,7 @@ efreet_icon_shutdown(void)
IF_FREE_LIST(efreet_extra_icon_dirs); IF_FREE_LIST(efreet_extra_icon_dirs);
ecore_shutdown(); ecore_shutdown();
efreet_icon_init_count = 0;
} }
/** /**