Compare commits

...

1 Commits

Author SHA1 Message Date
Christian Hergert
bdd7b6ec26 notebook: fix gtk_widget_unparent() with NULL child
When using gtk4-demo and closing the window (after changing notebook tabs),
a CRITICAL like the following is presented.

  gtk_widget_unparent: assertion 'GTK_IS_WIDGET (widget)' failed

This fixes that by conditionally checking that we have a valid widget still
within the GtkBin.
2019-10-04 12:41:23 -07:00

View File

@@ -5674,8 +5674,13 @@ static void
gtk_notebook_menu_label_unparent (GtkWidget *widget,
gpointer data)
{
gtk_widget_unparent (gtk_bin_get_child (GTK_BIN (widget)));
_gtk_bin_set_child (GTK_BIN (widget), NULL);
GtkWidget *child = gtk_bin_get_child (GTK_BIN (widget));
if (child != NULL)
{
gtk_widget_unparent (child);
_gtk_bin_set_child (GTK_BIN (widget), NULL);
}
}
/* Public GtkNotebook Page Insert/Remove Methods :