[gtk+] GtkStackSwitcher: Disconnect signals when a child is removed



commit 2e88ae8ad99a07e5adf1264dead14f71d978b461
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Sep 9 14:48:59 2014 -0400

    GtkStackSwitcher: Disconnect signals when a child is removed
    
    This is quite an oversight, and causes bad things to happen if
    the child is later changed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736307

 gtk/gtkstackswitcher.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkstackswitcher.c b/gtk/gtkstackswitcher.c
index 35d82b8..44fc7c8 100644
--- a/gtk/gtkstackswitcher.c
+++ b/gtk/gtkstackswitcher.c
@@ -330,6 +330,11 @@ on_stack_child_removed (GtkContainer     *container,
   GtkStackSwitcherPrivate *priv;
 
   priv = gtk_stack_switcher_get_instance_private (self);
+
+  g_signal_handlers_disconnect_by_func (widget, on_title_icon_visible_updated, self);
+  g_signal_handlers_disconnect_by_func (widget, on_position_updated, self);
+  g_signal_handlers_disconnect_by_func (widget, on_needs_attention_updated, self);
+
   button = g_hash_table_lookup (priv->buttons, widget);
   gtk_container_remove (GTK_CONTAINER (self), button);
   g_hash_table_remove (priv->buttons, widget);


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