[nautilus/wip/antoniof/meets-valgrind: 6/11] bookmark-list: Unref obj on each loop iteration
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/antoniof/meets-valgrind: 6/11] bookmark-list: Unref obj on each loop iteration
- Date: Mon, 21 Dec 2020 18:35:04 +0000 (UTC)
commit 5d0cae565d99b08c300632172403c70c6f97e240
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]