From 23ef1786175471e7adcf007563254a566ef5bacb Mon Sep 17 00:00:00 2001 From: Sebastian Dransfeld Date: Fri, 10 Dec 2010 20:29:50 +0000 Subject: [PATCH] Store only theme name Not safe to keep Efreet_Icon_Theme around, it is mmap'ed SVN revision: 55467 --- legacy/elementary/src/lib/elm_icon.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/legacy/elementary/src/lib/elm_icon.c b/legacy/elementary/src/lib/elm_icon.c index 64bb4cd66a..bf04e8ec5c 100644 --- a/legacy/elementary/src/lib/elm_icon.c +++ b/legacy/elementary/src/lib/elm_icon.c @@ -3,7 +3,7 @@ #ifdef ELM_EFREET #define NON_EXISTING (void *)-1 -static Efreet_Icon_Theme *icon_theme = NULL; +static const char *icon_theme = NULL; #endif /** @@ -304,8 +304,9 @@ _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int s if (icon_theme == NON_EXISTING) return EINA_FALSE; if (!icon_theme) { - icon_theme = efreet_icon_theme_find(getenv("E_ICON_THEME")); - if (!icon_theme) + Efreet_Icon_Theme *theme; + theme = efreet_icon_theme_find(getenv("E_ICON_THEME")); + if (!theme) { const char **itr; static const char *themes[] = { @@ -313,17 +314,20 @@ _icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, int s }; for (itr = themes; *itr; itr++) { - icon_theme = efreet_icon_theme_find(*itr); - if (icon_theme) break; + theme = efreet_icon_theme_find(*itr); + if (theme) break; } } + + if (!theme) + { + icon_theme = NON_EXISTING; + return EINA_FALSE; + } + else + icon_theme = eina_stringshare_add(theme->name.internal); } - if (!icon_theme) - { - icon_theme = NON_EXISTING; - return EINA_FALSE; - } - path = efreet_icon_path_find(icon_theme->name.internal, name, size); + path = efreet_icon_path_find(icon_theme, name, size); wd->freedesktop.use = !!path; if (wd->freedesktop.use) {