From 84b4f85f1a221dc0b2ac137268762409391addb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Sun, 4 Mar 2018 20:04:43 +0100 Subject: [PATCH] overlay: Make forall() remove-safe Since this is a GtkContainer, forall will be used to destroy all the widgets. --- gtk/gtkoverlay.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c index 6ec549b010..5d069e359c 100644 --- a/gtk/gtkoverlay.c +++ b/gtk/gtkoverlay.c @@ -459,11 +459,14 @@ gtk_overlay_forall (GtkContainer *overlay, { GtkWidget *child; - for (child = _gtk_widget_get_first_child (GTK_WIDGET (overlay)); - child != NULL; - child = _gtk_widget_get_next_sibling (child)) + child = gtk_widget_get_first_child (GTK_WIDGET (overlay)); + while (child != NULL) { + GtkWidget *next = gtk_widget_get_next_sibling (child); + (* callback) (child, callback_data); + + child = next; } }