[gnome-photos] edit-palette: Use g_auto*



commit c53e1149f0956368c4590e0a2e62e5bca002f83f
Author: Umang Jain <mailumangjain gmail com>
Date:   Sun Dec 3 11:35:37 2017 +0530

    edit-palette: Use g_auto*
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788174

 src/photos-edit-palette.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/photos-edit-palette.c b/src/photos-edit-palette.c
index efcb080..b8d24c9 100644
--- a/src/photos-edit-palette.c
+++ b/src/photos-edit-palette.c
@@ -161,9 +161,9 @@ photos_edit_palette_hide_details (PhotosEditPalette *self)
 void
 photos_edit_palette_show (PhotosEditPalette *self)
 {
-  GList *extensions;
+  g_autoptr (GList) extensions = NULL;
   GList *l;
-  GtkSizeGroup *size_group;
+  g_autoptr (GtkSizeGroup) size_group = NULL;
 
   gtk_container_foreach (GTK_CONTAINER (self), (GtkCallback) gtk_widget_destroy, NULL);
   g_list_free_full (self->tools, g_object_unref);
@@ -180,7 +180,7 @@ photos_edit_palette_show (PhotosEditPalette *self)
       GIOExtension *extension = (GIOExtension *) l->data;
       GType type;
       GtkWidget *row;
-      PhotosTool *tool;
+      g_autoptr (PhotosTool) tool = NULL;
 
       type = g_io_extension_get_type (extension);
       tool = PHOTOS_TOOL (g_object_new (type, NULL));
@@ -191,11 +191,7 @@ photos_edit_palette_show (PhotosEditPalette *self)
       photos_edit_palette_row_show (PHOTOS_EDIT_PALETTE_ROW (row));
 
       g_signal_connect_swapped (tool, "hide-requested", G_CALLBACK (photos_edit_palette_hide_requested), 
self);
-
-      g_object_unref (tool);
     }
 
   gtk_widget_show_all (GTK_WIDGET (self));
-  g_object_unref (size_group);
-  g_list_free (extensions);
 }


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