[gnome-photos/wip/rishi/issue-77-20181002: 2/3] local-item: Use g_auto*



commit 756690dacd6a53f5ba7dab64f942c9b427c02618
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Oct 2 10:56:18 2018 +0200

    local-item: Use g_auto*
    
    GExiv2 supports autocleanups since 0.10.8.
    
    https://gitlab.gnome.org/GNOME/gnome-photos/issues/77
    https://bugzilla.gnome.org/show_bug.cgi?id=790925

 src/photos-local-item.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
---
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index 49a40947..d0b8b13e 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -291,7 +291,7 @@ photos_local_item_metadata_add_shared (PhotosBaseItem  *item,
     };
   g_autoptr (GVariantType) array_type = NULL;
   g_autoptr (GVariantType) tuple_type = NULL;
-  GExiv2Metadata *metadata = NULL; /* TODO: Use g_autoptr */
+  g_autoptr (GExiv2Metadata) metadata = NULL;
   gboolean ret_val = FALSE;
   const gchar *mime_type;
   const gchar *shared_tag = "Xmp.gnome.photos-shared";
@@ -376,7 +376,6 @@ photos_local_item_metadata_add_shared (PhotosBaseItem  *item,
   ret_val = TRUE;
 
  out:
-  g_clear_object (&metadata);
   return ret_val;
 }
 


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