[nautilus/wip/antoniof/meets-valgrind: 6/12] bookmark-list: Unref obj on each loop iteration




commit 2d91fd620463639ecd0bf2439ebbe4087e73ccb5
Author: António Fernandes <antoniof gnome org>
Date:   Sun Dec 20 00:49:16 2020 +0000

    bookmark-list: Unref obj on each loop iteration
    
    Autocleanup works only at the end of the scope it's declared.
    
    So, it must be declared inside the loop to work as intended here.

 src/nautilus-bookmark-list.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/nautilus-bookmark-list.c b/src/nautilus-bookmark-list.c
index a0698d691..b2d7e66ea 100644
--- a/src/nautilus-bookmark-list.c
+++ b/src/nautilus-bookmark-list.c
@@ -258,7 +258,6 @@ nautilus_bookmark_list_item_with_location (NautilusBookmarkList *bookmarks,
                                            guint                *index)
 {
     GList *node;
-    g_autoptr (GFile) bookmark_location = NULL;
     NautilusBookmark *bookmark;
     guint idx;
 
@@ -269,6 +268,8 @@ nautilus_bookmark_list_item_with_location (NautilusBookmarkList *bookmarks,
 
     for (node = bookmarks->list; node != NULL; node = node->next)
     {
+        g_autoptr (GFile) bookmark_location = NULL;
+
         bookmark = node->data;
         bookmark_location = nautilus_bookmark_get_location (bookmark);
 


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