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




commit 194aa52a584a2c748014f9e8d9173b31138a1c3a
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]