From d13554a35c14debbfa618171d486016701851603 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 12 Apr 2006 04:22:51 +0000 Subject: [PATCH] Better fix --- gtk/gtkicontheme.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index a26e44274..5cad50443 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -975,7 +975,13 @@ insert_theme (GtkIconTheme *icon_theme, const char *theme_name) dirs = g_key_file_get_string_list (theme_file, "Icon Theme", "Directories", NULL, NULL); if (!dirs) - g_warning ("Theme file for %s has no directories\n", theme_name); + { + g_warning ("Theme file for %s has no directories\n", theme_name); + g_free (theme->display_name); + g_free (theme); + g_key_file_free (theme_file); + return; + } theme->comment = g_key_file_get_locale_string (theme_file, @@ -987,12 +993,11 @@ insert_theme (GtkIconTheme *icon_theme, const char *theme_name) NULL); theme->dirs = NULL; - if (dirs) - { - for (i = 0; dirs[i] != NULL; i++) - theme_subdir_load (icon_theme, theme, theme_file, dirs[i]); - g_strfreev (dirs); - } + for (i = 0; dirs[i] != NULL; i++) + theme_subdir_load (icon_theme, theme, theme_file, dirs[i]); + + g_strfreev (dirs); + theme->dirs = g_list_reverse (theme->dirs); themes = g_key_file_get_string_list (theme_file,