[Xfce4-commits] r26181 - in libxfcegui4: branches/xfce_4_4/libxfcegui4 trunk/libxfcegui4
Brian Tarricone
kelnos at xfce.org
Thu Oct 25 00:53:54 CEST 2007
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 <bjt23 at cornell.edu>
+ * Copyright (c) 2004-2007 Brian Tarricone <bjt23 at cornell.edu>
*
* 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 <bjt23 at cornell.edu>
+ * Copyright (c) 2004-2007 Brian Tarricone <bjt23 at cornell.edu>
*
* 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
More information about the Xfce4-commits
mailing list