[gnome-photos/wip/rishi/collection-icon-watcher-g-auto: 3/3] collection-icon-watcher: Make the reference counting more explicit




commit 8066866faa81ccce024d72136cfe812ce5d21403
Author: Debarshi Ray <debarshir gnome org>
Date:   Thu Apr 1 01:36:08 2021 +0200

    collection-icon-watcher: Make the reference counting more explicit

 src/photos-collection-icon-watcher.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-collection-icon-watcher.c b/src/photos-collection-icon-watcher.c
index b5277117..46e351d3 100644
--- a/src/photos-collection-icon-watcher.c
+++ b/src/photos-collection-icon-watcher.c
@@ -172,10 +172,10 @@ photos_collection_icon_watcher_to_query_executed (GObject *source_object, GAsync
 
   if (cursor != NULL && self->item_mngr != NULL)
     {
-      PhotosBaseItem *item;
+      g_autoptr (PhotosBaseItem) item = NULL;
 
       item = photos_item_manager_create_item (PHOTOS_ITEM_MANAGER (self->item_mngr), G_TYPE_NONE, cursor, 
TRUE);
-      self->items = g_list_prepend (self->items, item);
+      self->items = g_list_prepend (self->items, g_object_ref (item));
     }
 
   photos_collection_icon_watcher_to_query_collector (self);


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