gtkoverlay: Fix issues with remove

The iteration now progresses past a delete, so make sure we iterate
safely. Also, don't chain up if we removed a child.
This commit is contained in:
Alexander Larsson 2015-06-15 16:32:50 +02:00
parent 5cf2896308
commit 9fc19b5a26

View File

@ -497,13 +497,14 @@ gtk_overlay_remove (GtkContainer *container,
{
GtkOverlayPrivate *priv = GTK_OVERLAY (container)->priv;
GtkOverlayChild *child;
GSList *children;
GSList *children, *next;
gboolean removed;
removed = FALSE;
for (children = priv->children; children; children = children->next)
for (children = priv->children; children; children = next)
{
child = children->data;
next = children->next;
if (child->widget == widget)
{
@ -524,6 +525,7 @@ gtk_overlay_remove (GtkContainer *container,
gtk_widget_child_notify (child->widget, "index");
}
if (!removed)
GTK_CONTAINER_CLASS (gtk_overlay_parent_class)->remove (container, widget);
}