diff -r 0f75cd31966a -r 2d472ed937db pidgin/gtkthemes.c --- a/pidgin/gtkthemes.c Sun Aug 02 04:10:32 2009 +0000 +++ b/pidgin/gtkthemes.c Sun Aug 02 04:33:26 2009 +0000 @@ -229,7 +229,6 @@ struct smiley_list *list = NULL; GSList *lst = smiley_themes; char *dirname; - gboolean new_theme = FALSE; if (!f) return; @@ -243,16 +242,18 @@ lst = lst->next; } - if (!theme) { - new_theme = TRUE; - theme = g_new0(struct smiley_theme, 1); - theme->path = g_strdup(file); - } else if (theme == current_smiley_theme) { + if (theme == current_smiley_theme) { /* Don't reload the theme if it is already loaded */ fclose(f); return; } + if (theme == NULL) { + theme = g_new0(struct smiley_theme, 1); + theme->path = g_strdup(file); + smiley_themes = g_slist_prepend(smiley_themes, theme); + } + dirname = g_path_get_dirname(file); while (!feof(f)) { @@ -341,14 +342,11 @@ if (!theme->name || !theme->desc || !theme->author) { purple_debug_error("gtkthemes", "Invalid file format, not loading smiley theme from '%s'\n", file); + smiley_themes = g_slist_remove(smiley_themes, theme); pidgin_themes_destroy_smiley_theme(theme); return; } - if (new_theme) { - smiley_themes = g_slist_prepend(smiley_themes, theme); - } - if (load) { GList *cnv;