[gnome-photos] pipeline: Touch the result only after validating it



commit e79516c2850597e3f1e6ddbb0aa9b4cb4835ec4b
Author: Debarshi Ray <debarshir gnome org>
Date:   Fri Jul 27 19:51:44 2018 +0200

    pipeline: Touch the result only after validating it

 src/photos-pipeline.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/photos-pipeline.c b/src/photos-pipeline.c
index bf68b566..20957822 100644
--- a/src/photos-pipeline.c
+++ b/src/photos-pipeline.c
@@ -467,9 +467,11 @@ static gboolean
 photos_pipeline_async_initable_init_finish (GAsyncInitable *initable, GAsyncResult *res, GError **error)
 {
   PhotosPipeline *self = PHOTOS_PIPELINE (initable);
-  GTask *task = G_TASK (res);
+  GTask *task;
 
   g_return_val_if_fail (g_task_is_valid (res, self), FALSE);
+  task = G_TASK (res);
+
   g_return_val_if_fail (g_task_get_source_tag (task) == photos_pipeline_async_initable_init_async, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 
@@ -738,9 +740,11 @@ photos_pipeline_save_async (PhotosPipeline *self,
 gboolean
 photos_pipeline_save_finish (PhotosPipeline *self, GAsyncResult *res, GError **error)
 {
-  GTask *task = G_TASK (res);
+  GTask *task;
 
   g_return_val_if_fail (g_task_is_valid (res, self), FALSE);
+  task = G_TASK (res);
+
   g_return_val_if_fail (g_task_get_source_tag (task) == photos_pipeline_save_async, FALSE);
   g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
 


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