[gnome-photos/wip/rishi/thumbnailer: 2/16] local-item: Style fixes
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/wip/rishi/thumbnailer: 2/16] local-item: Style fixes
- Date: Mon, 13 Feb 2017 22:41:18 +0000 (UTC)
commit 8d67ca0f945fc3b3393d2731a43b16c7d86678bb
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 9079155..70fe4ed 100644
--- a/src/photos-local-item.c
+++ b/src/photos-local-item.c
@@ -99,8 +99,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;
@@ -109,9 +109,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]