diff options
author | Morten Welinder <terra@gnome.org> | 2004-04-19 19:52:45 +0000 |
---|---|---|
committer | Morten Welinder <mortenw@src.gnome.org> | 2004-04-19 19:52:45 +0000 |
commit | cfe7b384bc7892267d21385e3bc6a47577cbe3ce (patch) | |
tree | 8c24982f5dd651ca60d2923c9fa625fa4d664efd /gtk/gtktoolbar.c | |
parent | 0dc58fb24db662cf6363c4705f00ecc945d39ed9 (diff) | |
download | gdk-pixbuf-cfe7b384bc7892267d21385e3bc6a47577cbe3ce.tar.gz |
Don't leak list of children. (#140523)
2004-04-19 Morten Welinder <terra@gnome.org>
* gtk/gtktoolbar.c (gtk_toolbar_focus): Don't leak list of
children. (#140523)
Diffstat (limited to 'gtk/gtktoolbar.c')
-rw-r--r-- | gtk/gtktoolbar.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/gtk/gtktoolbar.c b/gtk/gtktoolbar.c index 56dd4ca49..6bc61aa41 100644 --- a/gtk/gtktoolbar.c +++ b/gtk/gtktoolbar.c @@ -1743,7 +1743,8 @@ gtk_toolbar_focus (GtkWidget *widget, { GtkToolbar *toolbar = GTK_TOOLBAR (widget); GList *children, *list; - + gboolean result = FALSE; + /* if focus is already somewhere inside the toolbar then return FALSE. * The only way focus can stay inside the toolbar is when the user presses * arrow keys or Ctrl TAB (both of which are handled by the @@ -1751,20 +1752,23 @@ gtk_toolbar_focus (GtkWidget *widget, */ if (GTK_CONTAINER (widget)->focus_child) return FALSE; - + children = gtk_toolbar_list_children_in_focus_order (toolbar, dir); - + for (list = children; list != NULL; list = list->next) { GtkWidget *child = list->data; if (GTK_WIDGET_MAPPED (child) && gtk_widget_child_focus (child, dir)) - return TRUE; + { + result = TRUE; + break; + } } - + g_list_free (children); - - return FALSE; + + return result; } static void |