From be5a7b2db2d8f4c8efa18f4ad2764a64163948d9 Mon Sep 17 00:00:00 2001 From: Daniel Boles Date: Thu, 12 Oct 2017 14:05:09 +0100 Subject: [PATCH] =?UTF-8?q?Fixed:=20If=20can=E2=80=99t=20add=20child,=20do?= =?UTF-8?q?n=E2=80=99t=20add=20to=20child=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the call to set_parent() failed, we were still adding the child to the internal list of children, despite that it was not really added. That meant we could later try to do invalid stuff with that non-child. Fix that by asserting and giving up if the child that the user is attempting to add is already parented. https://bugzilla.gnome.org/show_bug.cgi?id=701296 --- gtk/gtkfixed.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkfixed.c b/gtk/gtkfixed.c index bdb8e9570f..355929ecc7 100644 --- a/gtk/gtkfixed.c +++ b/gtk/gtkfixed.c @@ -235,6 +235,7 @@ gtk_fixed_put (GtkFixed *fixed, g_return_if_fail (GTK_IS_FIXED (fixed)); g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (_gtk_widget_get_parent (widget) == NULL); priv = fixed->priv;