[gnome-photos/wip/rishi/thumbnailer: 1/12] local-item: Style fixes



commit 15366bd7c69209430e9e3ba1527643f5f0bbb5ff
Author: Debarshi Ray <debarshir gnome org>
Date:   Sun Feb 12 03:36:04 2017 +0100

    local-item: Style fixes

 src/photos-local-item.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/photos-local-item.c b/src/photos-local-item.c
index 0fbc860..e4a7d59 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -98,8 +98,8 @@ photos_local_item_create_pipeline_path (PhotosBaseItem *item)
 static gboolean
 photos_local_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancellable, GError **error)
 {
-  GFile *file;
-  gboolean ret_val;
+  GFile *file = NULL;
+  gboolean ret_val = FALSE;
   const gchar *mime_type;
   const gchar *uri;
   gint64 mtime;
@@ -108,9 +108,14 @@ photos_local_item_create_thumbnail (PhotosBaseItem *item, GCancellable *cancella
   file = g_file_new_for_uri (uri);
   mime_type = photos_base_item_get_mime_type (item);
   mtime = photos_base_item_get_mtime (item);
-  ret_val = photos_utils_create_thumbnail (file, mime_type, mtime, cancellable, error);
 
-  g_object_unref (file);
+  if (!photos_utils_create_thumbnail (file, mime_type, mtime, cancellable, error))
+    goto out;
+
+  ret_val = TRUE;
+
+ out:
+  g_clear_object (&file);
   return ret_val;
 }
 


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