[gnome-photos/wip/rishi/base-item-g_auto] base-item: Make the reference counting more explicit



commit e7c9b635cf087b909a1883652ea2984f87e33fc4
Author: Debarshi Ray <debarshir gnome org>
Date:   Wed Apr 7 23:28:26 2021 +0200

    base-item: Make the reference counting more explicit
    
    https://gitlab.gnome.org/GNOME/gnome-photos/-/merge_requests/214

 src/photos-base-item.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 655742f6..124c5f39 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -385,7 +385,6 @@ photos_base_item_check_effects_and_update_info (PhotosBaseItem *self)
 {
   PhotosBaseItemPrivate *priv;
   GApplication *app;
-  GIcon *pix;
   g_autolist (GIcon) emblem_icons = NULL;
   GList *windows;
   g_autoptr (GdkPixbuf) emblemed_pixbuf = NULL;
@@ -404,8 +403,10 @@ photos_base_item_check_effects_and_update_info (PhotosBaseItem *self)
 
   if (priv->favorite)
     {
+      g_autoptr (GIcon) pix = NULL;
+
       pix = photos_base_item_create_symbolic_emblem ("starred", scale);
-      emblem_icons = g_list_prepend (emblem_icons, pix);
+      emblem_icons = g_list_prepend (emblem_icons, g_object_ref (pix));
     }
 
   if (emblem_icons != NULL)


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