ComboBox: Clean up handler disconnection some more
authorDaniel Boles <dboles@src.gnome.org>
Fri, 1 Sep 2017 10:43:44 +0000 (11:43 +0100)
committerDaniel Boles <dboles@src.gnome.org>
Fri, 1 Sep 2017 15:28:44 +0000 (16:28 +0100)
gtk/gtkcombobox.c

index a6e3a536d23772fa355e57982d4ad62aee8f0ed1..e672101abc4432e71b94c64af9a7c540670a1223 100644 (file)
@@ -2791,12 +2791,8 @@ gtk_combo_box_menu_destroy (GtkComboBox *combo_box)
 {
   GtkComboBoxPrivate *priv = combo_box->priv;
 
-  g_signal_handlers_disconnect_by_func (priv->button,
-                                        gtk_combo_box_menu_button_press, combo_box);
-  g_signal_handlers_disconnect_by_func (priv->button,
-                                        gtk_combo_box_button_state_flags_changed, combo_box);
-  g_signal_handlers_disconnect_by_func (priv->popup_widget,
-                                        gtk_combo_box_menu_activate, combo_box);
+  g_signal_handlers_disconnect_by_data (priv->button, combo_box);
+  g_signal_handlers_disconnect_by_data (priv->popup_widget, combo_box);
 
   /* changing the popup window will unref the menu and the children */
 }
@@ -3062,10 +3058,8 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
   GtkComboBoxPrivate *priv = combo_box->priv;
 
   /* disconnect signals */
+  g_signal_handlers_disconnect_by_data (priv->button, combo_box);
   g_signal_handlers_disconnect_by_data (priv->tree_view, combo_box);
-  g_signal_handlers_disconnect_by_func (priv->button,
-                                        gtk_combo_box_list_button_pressed,
-                                        combo_box);
   g_signal_handlers_disconnect_by_data (priv->popup_window, combo_box);
 
   if (priv->cell_view)
@@ -3088,8 +3082,8 @@ gtk_combo_box_list_destroy (GtkComboBox *combo_box)
     }
 
   gtk_widget_destroy (priv->tree_view);
-
   priv->tree_view = NULL;
+
   if (priv->popup_widget)
     {
       g_object_unref (priv->popup_widget);