r4160 - in trunk: . beast-gtk/gxk



Author: timj
Date: 2006-12-15 12:30:51 -0500 (Fri, 15 Dec 2006)
New Revision: 4160

Modified:
   trunk/ChangeLog
   trunk/beast-gtk/gxk/gxkutils.c
Log:
Fri Dec 15 18:21:46 2006  Tim Janik  <timj gtk org>

        * beast-gtk/gxk/gxkutils.c (popup_menus_detach): fixed menu_list type
        which is a GList, not a GSList, and has to be released as a GList.
        this fixes creeping memory corruption in GSlice.




Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2006-12-15 17:21:44 UTC (rev 4159)
+++ trunk/ChangeLog	2006-12-15 17:30:51 UTC (rev 4160)
@@ -1,3 +1,9 @@
+Fri Dec 15 18:21:46 2006  Tim Janik  <timj gtk org>
+
+	* beast-gtk/gxk/gxkutils.c (popup_menus_detach): fixed menu_list type
+	which is a GList, not a GSList, and has to be released as a GList.
+	this fixes creeping memory corruption in GSlice.
+
 Thu Dec 14 21:38:31 2006  Tim Janik  <timj gtk org>
 
 	* Makefile.decl (report): reintroduced tee(1) to preserve output

Modified: trunk/beast-gtk/gxk/gxkutils.c
===================================================================
--- trunk/beast-gtk/gxk/gxkutils.c	2006-12-15 17:21:44 UTC (rev 4159)
+++ trunk/beast-gtk/gxk/gxkutils.c	2006-12-15 17:30:51 UTC (rev 4160)
@@ -3428,10 +3428,10 @@
 static void
 popup_menus_detach (gpointer data)
 {
-  GSList *menu_list = data;
+  GList *menu_list = data;
   while (menu_list)
     {
-      GtkMenu *menu = g_slist_pop_head (&menu_list);
+      GtkMenu *menu = g_list_pop_head (&menu_list);
       if (gtk_menu_get_attach_widget (menu))
         gtk_menu_detach (menu);
     }
@@ -3465,11 +3465,10 @@
                                     GtkWidget        *widget,
                                     GtkMenuDetachFunc mdfunc)
 {
-  GList *menu_list;
   g_return_if_fail (GTK_IS_MENU (menu));
   g_return_if_fail (GTK_IS_WIDGET (widget));
 
-  menu_list = g_object_steal_data (widget, "GxkWidget-popup-menus");
+  GList *menu_list = g_object_steal_data (widget, "GxkWidget-popup-menus");
   menu_list = g_list_prepend (menu_list, menu);
   g_object_set_data_full (widget, "GxkWidget-popup-menus", menu_list, popup_menus_detach);
   g_object_set_data (menu, "gxk-GtkMenuDetachFunc", mdfunc);
@@ -3656,7 +3655,6 @@
       /* none found, search next level */
       for (list = children; list; list = list->next)
         {
-          GList *extra_children;
           widget = list->data;
           if (GTK_IS_CONTAINER (widget))
             newlist = g_list_concat (gtk_container_get_children (GTK_CONTAINER (widget)), newlist);
@@ -3666,7 +3664,7 @@
               if (mitem->submenu)
                 newlist = g_list_prepend (newlist, mitem->submenu);
             }
-          extra_children = g_object_get_data (widget, "GxkWidget-popup-menus");
+          GList *extra_children = g_object_get_data (widget, "GxkWidget-popup-menus");
           if (extra_children)
             newlist = g_list_concat (g_list_copy (extra_children), newlist);
         }




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