Author: kelnos
Date: 2007-10-24 22:53:54 +0000 (Wed, 24 Oct 2007)
New Revision: 26181

Modified:
   libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce-appmenuitem.c
   libxfcegui4/trunk/libxfcegui4/xfce-appmenuitem.c
Log:
fix memory leak - gtk_container_get_children() returns an alloced GList


Modified: libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce-appmenuitem.c
===================================================================
--- libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce-appmenuitem.c        
2007-10-24 22:26:53 UTC (rev 26180)
+++ libxfcegui4/branches/xfce_4_4/libxfcegui4/xfce-appmenuitem.c        
2007-10-24 22:53:54 UTC (rev 26181)
@@ -1,8 +1,8 @@
-/* 
+/*
  * xfce-appmenuitem - a GtkImageMenuItem subclass that handles menu
  * items that are intended to represent applications
  *
- * Copyright (c) 2004 Brian Tarricone <[EMAIL PROTECTED]>
+ * Copyright (c) 2004-2007 Brian Tarricone <[EMAIL PROTECTED]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -89,9 +89,11 @@
     style = gtk_rc_get_style_by_paths(gtk_settings_get_default(),
             "GtkMenuItem", "GtkMenuItem", GTK_TYPE_IMAGE_MENU_ITEM);
     children = gtk_container_get_children(GTK_CONTAINER(w));
-    for(l = children; l; l = l->next)
+    for(l = children; l; l = l->next) {
         if(GTK_IS_WIDGET(l->data))
-            gtk_widget_set_style(GTK_WIDGET(l->data), style);    
+            gtk_widget_set_style(GTK_WIDGET(l->data), style);
+    }
+    g_list_free(children);
 }
 
 static void

Modified: libxfcegui4/trunk/libxfcegui4/xfce-appmenuitem.c
===================================================================
--- libxfcegui4/trunk/libxfcegui4/xfce-appmenuitem.c    2007-10-24 22:26:53 UTC 
(rev 26180)
+++ libxfcegui4/trunk/libxfcegui4/xfce-appmenuitem.c    2007-10-24 22:53:54 UTC 
(rev 26181)
@@ -1,8 +1,8 @@
-/* 
+/*
  * xfce-appmenuitem - a GtkImageMenuItem subclass that handles menu
  * items that are intended to represent applications
  *
- * Copyright (c) 2004 Brian Tarricone <[EMAIL PROTECTED]>
+ * Copyright (c) 2004-2007 Brian Tarricone <[EMAIL PROTECTED]>
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -94,9 +94,11 @@
     style = gtk_rc_get_style_by_paths(gtk_settings_get_default(),
             "GtkMenuItem", "GtkMenuItem", GTK_TYPE_IMAGE_MENU_ITEM);
     children = gtk_container_get_children(GTK_CONTAINER(w));
-    for(l = children; l; l = l->next)
+    for(l = children; l; l = l->next) {
         if(GTK_IS_WIDGET(l->data))
-            gtk_widget_set_style(GTK_WIDGET(l->data), style);    
+            gtk_widget_set_style(GTK_WIDGET(l->data), style);
+    }
+    g_list_free(children);
 }
 
 static void

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to