[gnome-photos] base-item: Shuffle some code around



commit 7f991e8f75289a9d3af32bc7b84e18e4c4d9a218
Author: Umang Jain <mailumangjain gmail com>
Date:   Tue Apr 12 09:46:24 2016 +0200

    base-item: Shuffle some code around
    
    It is better to keep the clean-up code in one place, unless absolutely
    necessary.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763908

 src/photos-base-item.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index b3aa3d8..d1ee166 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -635,7 +635,7 @@ photos_base_item_refresh_thumb_path_read (GObject *source_object, GAsyncResult *
   PhotosBaseItemPrivate *priv = self->priv;
   GError *error = NULL;
   GFile *file = G_FILE (source_object);
-  GFileInputStream *stream;
+  GFileInputStream *stream = NULL;
 
   stream = g_file_read_finish (file, res, &error);
   if (error != NULL)
@@ -658,9 +658,8 @@ photos_base_item_refresh_thumb_path_read (GObject *source_object, GAsyncResult *
                                     priv->cancellable,
                                     photos_base_item_refresh_thumb_path_pixbuf,
                                     self);
-  g_object_unref (stream);
-
  out:
+  g_clear_object (&stream);
   g_object_unref (self);
 }
 


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