[nautilus] window-manage-views: plug a memory leak



commit 0d191f445da18d0bed1c8ca6d3e05dc4ffae4293
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed Sep 28 18:49:18 2011 -0400

    window-manage-views: plug a memory leak
    
    We have to free the new selection list when we build it ourselves.

 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 8e1f3d8..d549647 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) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]