Patch for GtkMenu HEAD



I just stumbled over a bug in GTK+ HEAD that might cause some grief
(i.e. GList corruption, crashes). Since I'm not a regular contributor to
GTK, I'm sending a patch. See ChangeLog for details.

-- 
Hans Petter



? gtkmenu-attach-steal.patch
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtk+/ChangeLog,v
retrieving revision 1.5749
diff -u -p -r1.5749 ChangeLog
--- ChangeLog	25 Aug 2004 04:04:32 -0000	1.5749
+++ ChangeLog	25 Aug 2004 05:55:14 -0000
@@ -1,3 +1,8 @@
+2004-08-25  Hans Petter Jansson  <hpj ximian com>
+
+	* gtk/gtkmenu.c (gtk_menu_attach_to_widget): Steal ATTACHED_MENUS
+	list so its tail isn't freed when we re-set it.
+
 2004-08-24  Matthias Clasen  <mclasen redhat com>
 
 	* NEWS: Updates for 2.5.2
Index: gtk/gtkmenu.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtkmenu.c,v
retrieving revision 1.180
diff -u -p -r1.180 gtkmenu.c
--- gtk/gtkmenu.c	9 Aug 2004 16:59:52 -0000	1.180
+++ gtk/gtkmenu.c	25 Aug 2004 05:55:15 -0000
@@ -1037,7 +1037,7 @@ gtk_menu_attach_to_widget (GtkMenu	     
   
   data->detacher = detacher;
   g_object_set_data (G_OBJECT (menu), attach_data_key, data);
-  list = g_object_get_data (G_OBJECT (attach_widget), ATTACHED_MENUS);
+  list = g_object_steal_data (G_OBJECT (attach_widget), ATTACHED_MENUS);
   if (!g_list_find (list, menu))
     {
       list = g_list_prepend (list, menu);


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