diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2011-09-28 18:49:18 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-10-17 09:49:03 -0400 |
commit | 6010667f92e5f971ba2793297f84f270ba0e156f (patch) | |
tree | b1d69f909455173d1517d59cf9088891687c6607 | |
parent | 5c815d36162e5efd321550b7b2364445a77ef1f6 (diff) | |
download | nautilus-6010667f92e5f971ba2793297f84f270ba0e156f.tar.gz |
window-manage-views: plug a memory leak
We have to free the new selection list when we build it ourselves.
-rw-r--r-- | src/nautilus-window-manage-views.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/nautilus-window-manage-views.c b/src/nautilus-window-manage-views.c index 8e1f3d82d..d54964766 100644 --- a/src/nautilus-window-manage-views.c +++ b/src/nautilus-window-manage-views.c @@ -693,6 +693,7 @@ begin_location_change (NautilusWindowSlot *slot, gboolean force_reload; char *current_pos; GFile *from_folder, *parent; + GList *parent_selection = NULL; g_assert (slot != NULL); g_assert (location != NULL); @@ -714,7 +715,8 @@ begin_location_change (NautilusWindowSlot *slot, } if (parent != NULL) { - new_selection = g_list_prepend (NULL, nautilus_file_get (from_folder)); + new_selection = parent_selection = + g_list_prepend (NULL, nautilus_file_get (from_folder)); g_object_unref (parent); } @@ -763,6 +765,10 @@ begin_location_change (NautilusWindowSlot *slot, nautilus_directory_unref (directory); + if (parent_selection != NULL) { + g_list_free_full (parent_selection, g_object_unref); + } + /* Set current_bookmark scroll pos */ if (slot->current_location_bookmark != NULL && slot->content_view != NULL) { |