]> Pileus Git - ~andy/gtk/commitdiff
Destroy the menu in dispose instead of finalize, because the menu might
authorArmin Burgmeier <armin@openismus.com>
Wed, 2 May 2007 22:19:45 +0000 (22:19 +0000)
committerArmin Burgmeier <arminb@src.gnome.org>
Wed, 2 May 2007 22:19:45 +0000 (22:19 +0000)
2007-05-02  Armin Burgmeier  <armin@openismus.com>

* gtk/gtkcombobox.c: Destroy the menu in dispose instead of
finalize, because the menu might unparent itself from its parent and
cause a signal emission on a finalized object. (#430746)

svn path=/trunk/; revision=17782

ChangeLog
gtk/gtkcombobox.c

index a0d562f265e62da3de9ddcbcae2269bc8d08c3f8..80fc6cbfdbc030acaa90374f87169d5868d24c37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-05-02  Armin Burgmeier  <armin@openismus.com>
+
+       * gtk/gtkcombobox.c: Destroy the menu in dispose instead of
+       finalize, because the menu might unparent itself from its parent and
+       cause a signal emission on a finalized object. (#430746)
+
 2007-05-02  Dom Lachowicz <domlachowicz@gmail.com>
 
        * modules/engines/ms-windows/msw_style.c: MS-Windows Theme top tabs 
index b379446650ce094c91092da353dcbf8e4266e955..afdc67876fd7301fbaa30232b40c54b42e4b0ca9 100644 (file)
@@ -215,6 +215,7 @@ static guint combo_box_signals[LAST_SIGNAL] = {0,};
 
 static void     gtk_combo_box_cell_layout_init     (GtkCellLayoutIface *iface);
 static void     gtk_combo_box_cell_editable_init   (GtkCellEditableIface *iface);
+static void     gtk_combo_box_dispose              (GObject          *object);
 static void     gtk_combo_box_finalize             (GObject          *object);
 static void     gtk_combo_box_destroy              (GtkObject        *object);
 
@@ -482,6 +483,7 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
   gtk_object_class->destroy = gtk_combo_box_destroy;
 
   object_class = (GObjectClass *)klass;
+  object_class->dispose = gtk_combo_box_dispose;
   object_class->finalize = gtk_combo_box_finalize;
   object_class->set_property = gtk_combo_box_set_property;
   object_class->get_property = gtk_combo_box_get_property;
@@ -5170,17 +5172,25 @@ gtk_combo_box_destroy (GtkObject *object)
 }
 
 static void
-gtk_combo_box_finalize (GObject *object)
+gtk_combo_box_dispose(GObject* object)
 {
   GtkComboBox *combo_box = GTK_COMBO_BOX (object);
-  GSList *i;
-  
+
   if (GTK_IS_MENU (combo_box->priv->popup_widget))
     {
       gtk_combo_box_menu_destroy (combo_box);
       gtk_menu_detach (GTK_MENU (combo_box->priv->popup_widget));
       combo_box->priv->popup_widget = NULL;
     }
+
+  G_OBJECT_CLASS (gtk_combo_box_parent_class)->dispose (object);
+}
+
+static void
+gtk_combo_box_finalize (GObject *object)
+{
+  GtkComboBox *combo_box = GTK_COMBO_BOX (object);
+  GSList *i;
   
   if (GTK_IS_TREE_VIEW (combo_box->priv->tree_view))
     gtk_combo_box_list_destroy (combo_box);