diff --git a/ChangeLog b/ChangeLog index a0d562f265..80fc6cbfdb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-05-02 Armin Burgmeier + + * 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 * modules/engines/ms-windows/msw_style.c: MS-Windows Theme top tabs diff --git a/gtk/gtkcombobox.c b/gtk/gtkcombobox.c index b379446650..afdc67876f 100644 --- a/gtk/gtkcombobox.c +++ b/gtk/gtkcombobox.c @@ -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);