[gtk/wip/baedert/for-master: 99/104] listbox: Add preconditions to remove()




commit 27f3600419ad49bc5bd3c2df1df1c6c07a0041c9
Author: Timm Bäder <mail baedert org>
Date:   Fri Sep 4 08:48:45 2020 +0200

    listbox: Add preconditions to remove()

 gtk/gtklistbox.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtklistbox.c b/gtk/gtklistbox.c
index 73a8995608..b028df0f11 100644
--- a/gtk/gtklistbox.c
+++ b/gtk/gtklistbox.c
@@ -2272,16 +2272,20 @@ gtk_list_box_row_visibility_changed (GtkListBox    *box,
  * Removes a child from @box.
  */
 void
-gtk_list_box_remove (GtkListBox   *box,
-                     GtkWidget    *child)
+gtk_list_box_remove (GtkListBox *box,
+                     GtkWidget  *child)
 {
-  GtkWidget *widget = GTK_WIDGET (box);
+  GtkWidget *widget;
   gboolean was_visible;
   gboolean was_selected;
   GtkListBoxRow *row;
   GSequenceIter *iter;
   GSequenceIter *next;
 
+  g_return_if_fail (GTK_IS_LIST_BOX (box));
+  g_return_if_fail (GTK_IS_WIDGET (child));
+
+  widget = GTK_WIDGET (box);
   was_visible = gtk_widget_get_visible (child);
 
   if (child == box->placeholder)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]