GtkAssistant: Fix criticals on dispose
authorMatthias Clasen <mclasen@redhat.com>
Sat, 20 Jun 2015 01:56:29 +0000 (21:56 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 20 Jun 2015 01:56:29 +0000 (21:56 -0400)
After the recent change thta introduced boxes between the pages
and the notebook, we were no longer careful enough when disposing
the assistant. Fix that up.

gtk/gtkassistant.c

index 3d989637d22f1743006757f889cb7ff796b6ae51..b6d2d82d6afca5328349f907a31c0b1835dc3138 100644 (file)
@@ -1472,7 +1472,9 @@ gtk_assistant_remove (GtkContainer *container,
 
   /* Forward this removal to the content notebook */
   box = gtk_widget_get_parent (page);
-  if (gtk_widget_get_parent (box) == assistant->priv->content)
+  if (GTK_IS_BOX (box) &&
+      assistant->priv->content != NULL &&
+      gtk_widget_get_parent (box) == assistant->priv->content)
     {
       container = (GtkContainer *) assistant->priv->content;
       gtk_container_remove (container, box);