diff options
author | Christopher Davis <christopherdavis@gnome.org> | 2022-01-31 16:30:58 -0800 |
---|---|---|
committer | Christopher Davis <christopherdavis@gnome.org> | 2022-01-31 16:30:58 -0800 |
commit | 220115c78a1c876f6cb039917baf7265bb4ebe54 (patch) | |
tree | 640875f0a0e4beac7e0b90b231d2754a62dea86a | |
parent | d033a099ae01efd0c339423b375a55eb867a0b22 (diff) | |
download | gtk+-wip/cdavis/listbox-dispose-fix.tar.gz |
gtklistbox: Use get_row_at_index () for iterating in dispose ()wip/cdavis/listbox-dispose-fix
Previously we used `get_first_child ()`, which could
cause issues with e.g. headers.
-rw-r--r-- | gtk/gtklistbox.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c index 3a75bc0f3e..b3c42bea3f 100644 --- a/gtk/gtklistbox.c +++ b/gtk/gtklistbox.c @@ -433,9 +433,11 @@ gtk_list_box_dispose (GObject *object) { GtkWidget *child; - while ((child = gtk_widget_get_first_child (GTK_WIDGET (object)))) + while ((child = GTK_WIDGET (gtk_list_box_get_row_at_index (GTK_LIST_BOX (object), 0)))) gtk_list_box_remove (GTK_LIST_BOX (object), child); + gtk_list_box_set_placeholder (GTK_LIST_BOX (object), NULL); + G_OBJECT_CLASS (gtk_list_box_parent_class)->dispose (object); } |