[gnome-photos] glib: Limit the scope of the variables
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos] glib: Limit the scope of the variables
- Date: Thu, 7 Dec 2017 10:34:53 +0000 (UTC)
commit eb0966016880e9a985b5f836316b44929db8b314
Author: Debarshi Ray <debarshir gnome org>
Date: Tue Dec 5 12:14:27 2017 +0100
glib: Limit the scope of the variables
This was enabled by the use of g_auto*.
src/photos-glib.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-glib.c b/src/photos-glib.c
index 61e0eed..aa4fada 100644
--- a/src/photos-glib.c
+++ b/src/photos-glib.c
@@ -145,11 +145,9 @@ photos_glib_file_create_create (GObject *source_object, GAsyncResult *res, gpoin
GCancellable *cancellable;
GError *error = NULL;
GFile *file = G_FILE (source_object);
- g_autoptr (GFile) unique_file = NULL;
g_autoptr (GFileOutputStream) stream = NULL;
g_autoptr (GTask) task = G_TASK (user_data);
PhotosGLibFileCreateData *data;
- g_autofree gchar *filename = NULL;
cancellable = g_task_get_cancellable (task);
data = (PhotosGLibFileCreateData *) g_task_get_task_data (task);
@@ -157,6 +155,9 @@ photos_glib_file_create_create (GObject *source_object, GAsyncResult *res, gpoin
stream = g_file_create_finish (file, res, &error);
if (error != NULL)
{
+ g_autoptr (GFile) unique_file = NULL;
+ g_autofree gchar *filename = NULL;
+
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_EXISTS))
{
g_task_return_error (task, error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]