Avoid a crash

This commit is contained in:
Matthias Clasen
2005-11-14 18:46:29 +00:00
parent b12b6a1c0c
commit cb6fc02331
3 changed files with 16 additions and 5 deletions

View File

@@ -1,3 +1,8 @@
2005-11-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (gtk_icon_theme_get_icon_sizes):
Don't crash if there is no builtin icon.
2005-11-13 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkcolor.c (gdk_color_parse): Documentation

View File

@@ -1,3 +1,8 @@
2005-11-14 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (gtk_icon_theme_get_icon_sizes):
Don't crash if there is no builtin icon.
2005-11-13 Matthias Clasen <mclasen@redhat.com>
* gdk/gdkcolor.c (gdk_color_parse): Documentation

View File

@@ -1490,12 +1490,13 @@ gtk_icon_theme_get_icon_sizes (GtkIconTheme *icon_theme,
icons = g_hash_table_lookup (icon_theme_builtin_icons, icon_name);
for ( ; icons; icons = icons->next);
{
BuiltinIcon *icon = icons->data;
while (icons)
{
BuiltinIcon *icon = icons->data;
g_hash_table_insert (sizes, GINT_TO_POINTER (icon->size), NULL);
}
g_hash_table_insert (sizes, GINT_TO_POINTER (icon->size), NULL);
icons = icons->next;
}
}
r = result = g_new0 (gint, g_hash_table_size (sizes) + 1);