? stamp-h1
Index: gail/gailbutton.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailbutton.c,v
retrieving revision 1.75
diff -u -p -r1.75 gailbutton.c
--- gail/gailbutton.c	20 Aug 2004 07:23:28 -0000	1.75
+++ gail/gailbutton.c	18 Aug 2005 14:58:19 -0000
@@ -495,7 +495,10 @@ gail_button_do_action (AtkAction *action
 	}
       g_queue_push_head (button->action_queue, (gpointer) i);
       if (!button->action_idle_handler)
-	button->action_idle_handler = g_idle_add (idle_do_action, button);
+        {
+	  g_object_ref (button);
+	  button->action_idle_handler = g_idle_add (idle_do_action, button);
+	}
       break;
     default:
       return_value = FALSE;
@@ -516,13 +519,19 @@ idle_do_action (gpointer data)
 
   widget = GTK_ACCESSIBLE (gail_button)->widget;
   if (widget == NULL)
-    /*
-     * State is defunct
-     */
-    return FALSE;
+    {
+      /*
+       * State is defunct
+       */
+      g_object_unref (gail_button);
+      return FALSE;
+    }
 
   if (!GTK_WIDGET_IS_SENSITIVE (widget) || !GTK_WIDGET_VISIBLE (widget))
-    return FALSE;
+    {
+      g_object_unref (gail_button);
+      return FALSE;
+    }
 
   button = GTK_BUTTON (widget); 
   while (!g_queue_is_empty (gail_button->action_queue)) 
@@ -570,6 +579,9 @@ idle_do_action (gpointer data)
 	  break;
 	}
     }
+
+  g_object_unref (gail_button);
+
   return FALSE; 
 }
 
Index: gail/gailmenuitem.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailmenuitem.c,v
retrieving revision 1.47
diff -u -p -r1.47 gailmenuitem.c
--- gail/gailmenuitem.c	4 Jun 2004 07:36:51 -0000	1.47
+++ gail/gailmenuitem.c	18 Aug 2005 14:58:20 -0000
@@ -310,7 +310,10 @@ gail_menu_item_do_action (AtkAction *act
       if (gail_menu_item->action_idle_handler)
         return FALSE;
       else
-        gail_menu_item->action_idle_handler = g_idle_add (idle_do_action, gail_menu_item);
+        {
+	  g_object_ref (gail_menu_item);
+          gail_menu_item->action_idle_handler = g_idle_add (idle_do_action, gail_menu_item);
+	}
       return TRUE;
     }
   else
@@ -353,11 +356,17 @@ idle_do_action (gpointer data)
   menu_item->action_idle_handler = 0;
   item = GTK_ACCESSIBLE (menu_item)->widget;
   if (item == NULL)
-    /* State is defunct */
-    return FALSE;
+    {
+      /* State is defunct */
+      g_object_unref (menu_item);
+      return FALSE;
+    }
 
   if (!GTK_WIDGET_SENSITIVE (item) || !GTK_WIDGET_VISIBLE (item))
-    return FALSE;
+    {
+      g_object_unref (menu_item);
+      return FALSE;
+    }
 
   item_parent = gtk_widget_get_parent (item);
   gtk_menu_shell_select_item (GTK_MENU_SHELL (item_parent), item);
@@ -369,6 +378,9 @@ idle_do_action (gpointer data)
                          /*force_hide*/ 1); 
   if (!item_mapped)
     ensure_menus_unposted (menu_item);
+
+  g_object_unref (menu_item);
+
   return FALSE;
 }
 
