[gtk+/font-chooser] Make destroying assistants work again



commit 151c6e7010c60358c58e5a2815d95d811a99e0a7
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Jul 17 19:35:37 2011 -0400

    Make destroying assistants work again
    
    During destruction, we need to be careful to not ask the content
    notebook to remove itself from itself.

 gtk/gtkassistant.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkassistant.c b/gtk/gtkassistant.c
index 0bed0d5..c0f72a6 100644
--- a/gtk/gtkassistant.c
+++ b/gtk/gtkassistant.c
@@ -1300,9 +1300,12 @@ gtk_assistant_remove (GtkContainer *container,
 {
   GtkAssistant *assistant = (GtkAssistant*) container;
 
-  /* Forward this removal to the content notebook. */
-  container = (GtkContainer *) assistant->priv->content;
-  gtk_container_remove (container, page);
+  /* Forward this removal to the content notebook */
+  if (gtk_widget_get_parent (page) == assistant->priv->content)
+    {
+      container = (GtkContainer *) assistant->priv->content;
+      gtk_container_remove (container, page);
+    }
 }
 
 /**
@@ -1668,7 +1671,7 @@ gtk_assistant_remove_page (GtkAssistant *assistant,
   page = gtk_assistant_get_nth_page (assistant, page_num);
 
   if (page)
-    gtk_assistant_remove (assistant, page);
+    gtk_assistant_remove (GTK_CONTAINER (assistant), page);
 }
 
 /**



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]