summaryrefslogtreecommitdiff
path: root/gtk/gtklist.c
diff options
context:
space:
mode:
authorTim Janik <timj@src.gnome.org>1998-02-28 20:19:20 +0000
committerTim Janik <timj@src.gnome.org>1998-02-28 20:19:20 +0000
commitc4c1c1ea5563a4158308a41174aee07d3c8efcc8 (patch)
tree39bd1200e0733556bb4e4721872fe05dda14c8a1 /gtk/gtklist.c
parent6d3ef70d1eacd0d7d6b167d4b869ed71b92a88b6 (diff)
downloadgtk+-c4c1c1ea5563a4158308a41174aee07d3c8efcc8.tar.gz
more fixups -timj
more fixups -timj
Diffstat (limited to 'gtk/gtklist.c')
-rw-r--r--gtk/gtklist.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gtk/gtklist.c b/gtk/gtklist.c
index 81c7ffdc30..948c7df563 100644
--- a/gtk/gtklist.c
+++ b/gtk/gtklist.c
@@ -411,13 +411,14 @@ gtk_list_clear_items (GtkList *list,
if ((end < 0) || (end > nchildren))
end = nchildren;
- g_return_if_fail (start < end);
+ if (start >= end)
+ return;
start_list = g_list_nth (list->children, start);
end_list = g_list_nth (list->children, end);
if (start_list->prev)
- start_list->prev->next = end_list;
+ start_list->prev->next = end_list;
if (end_list && end_list->prev)
end_list->prev->next = NULL;
if (end_list)
@@ -441,17 +442,16 @@ gtk_list_clear_items (GtkList *list,
gtk_widget_unref (widget);
}
- /* list->children = g_list_remove (list->children, widget); */
- /* gtk_widget_unparent (widget); */
-
gtk_widget_unparent (widget);
}
+ g_list_free (start_list);
+
if (list->children && !list->selection &&
(list->selection_mode == GTK_SELECTION_BROWSE))
{
- gtk_list_select_child (list, widget);
widget = list->children->data;
+ gtk_list_select_child (list, widget);
}
if (selection_changed)