Don't leak the list of children (#357454, Paolo Borelli)

2006-09-25  Matthias Clasen  <mclasen@redhat.com>
        * gtk/gtkuimanager.c (_gtk_menu_is_empty): Don't leak
        the list of children (#357454, Paolo Borelli)
This commit is contained in:
Matthias Clasen 2006-09-25 13:36:00 +00:00 committed by Matthias Clasen
parent e049989bc3
commit c6a50a8194
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-09-25 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkuimanager.c (_gtk_menu_is_empty): Don't leak
the list of children (#357454, Paolo Borelli)
2006-09-25 Michael Natterer <mitch@imendio.com>
* gdk/x11/gdkdisplay-x11.c (gdk_display_x11_finalize): free

View File

@ -1941,6 +1941,7 @@ gboolean
_gtk_menu_is_empty (GtkWidget *menu)
{
GList *children, *cur;
gboolean result = TRUE;
g_return_val_if_fail (menu == NULL || GTK_IS_MENU (menu), TRUE);
@ -1956,13 +1957,16 @@ _gtk_menu_is_empty (GtkWidget *menu)
{
if (!GTK_IS_TEAROFF_MENU_ITEM (cur->data) &&
!g_object_get_data (cur->data, "gtk-empty-menu-item"))
return FALSE;
{
result = FALSE;
break;
}
}
cur = cur->next;
}
g_list_free (children);
return TRUE;
return result;
}
enum {