Index: gailbutton.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailbutton.c,v
retrieving revision 1.76
diff -u -p -r1.76 gailbutton.c
--- gailbutton.c	24 Nov 2005 15:41:55 -0000	1.76
+++ gailbutton.c	7 Apr 2006 09:53:56 -0000
@@ -64,6 +64,10 @@ static G_CONST_RETURN gchar* gail_button
 static gboolean              gail_button_set_description(AtkAction      *action,
                                                          gint           i,
                                                          const gchar    *desc);
+static void                  gail_button_notify_label_weak_ref (gpointer data, 
+								GObject  *obj);
+static void                  gail_button_notify_weak_ref       (gpointer data,
+								GObject  *obj);
 
 
 /* AtkImage.h */
@@ -409,6 +413,43 @@ gail_button_notify_label_gtk (GObject   
 }
 
 static void
+gail_button_notify_weak_ref (gpointer data, GObject* obj)
+{
+  GtkLabel *label = NULL;
+
+  AtkObject* atk_obj = ATK_OBJECT (obj);
+  if (data && GTK_IS_WIDGET (data))
+    {
+      label = GTK_LABEL (data);
+      if (label)
+	{
+	  g_signal_handlers_disconnect_by_func (label,
+						(GCallback) gail_button_notify_label_gtk,
+						GAIL_BUTTON (atk_obj));
+	  g_object_weak_unref (G_OBJECT (label), 
+			       gail_button_notify_label_weak_ref, 
+			       GAIL_BUTTON (atk_obj));
+	}
+    }
+}
+
+static void
+gail_button_notify_label_weak_ref (gpointer data, GObject* obj)
+{
+  GtkLabel *label = NULL;
+  GailButton *button = NULL;
+
+  label = GTK_LABEL (obj);
+  if (data && GAIL_IS_BUTTON (data))
+    {
+      button = GAIL_BUTTON (ATK_OBJECT (data));
+       if (button)
+	 g_object_weak_unref (G_OBJECT (ATK_OBJECT (button)), gail_button_notify_weak_ref,
+			      label);
+    }
+}
+
+static void
 gail_button_init_textutil (GailButton  *button,
                            GtkWidget   *label)
 {
@@ -417,6 +458,12 @@ gail_button_init_textutil (GailButton  *
   button->textutil = gail_text_util_new ();
   label_text = gtk_label_get_text (GTK_LABEL (label));
   gail_text_util_text_setup (button->textutil, label_text);
+  g_object_weak_ref (G_OBJECT (ATK_OBJECT (button)), 
+		     gail_button_notify_weak_ref, label);
+
+  g_object_weak_ref (G_OBJECT (label),
+		     gail_button_notify_label_weak_ref, button);
+
   g_signal_connect (label,
                     "notify",
                     (GCallback) gail_button_notify_label_gtk,
