[gnome-photos] tool-filter-button: Use g_auto*



commit c436f6c05a09fb349fbd51b9930a9a895dd3cadf
Author: Umang Jain <mailumangjain gmail com>
Date:   Sun Dec 3 22:16:30 2017 +0530

    tool-filter-button: Use g_auto*
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788174

 src/photos-tool-filter-button.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-tool-filter-button.c b/src/photos-tool-filter-button.c
index 2407471..1807baa 100644
--- a/src/photos-tool-filter-button.c
+++ b/src/photos-tool-filter-button.c
@@ -108,10 +108,10 @@ photos_tool_filter_button_constructed (GObject *object)
 {
   PhotosToolFilterButton *self = PHOTOS_TOOL_FILTER_BUTTON (object);
   GApplication *app;
-  GdkPixbuf *preview_icon = NULL;
+  g_autoptr (GdkPixbuf) preview_icon = NULL;
   GtkWidget *image;
   PhotosWidgetShader *shader;
-  cairo_surface_t *preview_icon_surface = NULL;
+  cairo_surface_t *preview_icon_surface = NULL; /* TODO: use g_autoptr */
   gint scale;
 
   G_OBJECT_CLASS (photos_tool_filter_button_parent_class)->constructed (object);
@@ -138,7 +138,6 @@ photos_tool_filter_button_constructed (GObject *object)
   g_signal_connect_swapped (self->button, "toggled", G_CALLBACK (photos_tool_filter_button_toggled), self);
   photos_tool_filter_button_toggled (self);
 
-  g_clear_object (&preview_icon);
   g_clear_pointer (&preview_icon_surface, (GDestroyNotify) cairo_surface_destroy);
   self->group = NULL; /* We will not need it any more */
 }


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