[gnome-photos] base-item: Reset the GError before using it



commit 0fe2e448c7cb94f5cf316b001f51afa4bb059ab6
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Apr 12 10:17:11 2016 +0200

    base-item: Reset the GError before using it
    
    Although it is not strictly necessary, this does make it more
    reassuring to read the code. There is nothing worse than getting a
    WARNING from trying to overwrite an existing GError.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763908

 src/photos-base-item.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index 90da5eb..ab64ae2 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -1480,12 +1480,13 @@ static void
 photos_base_item_print_load (GObject *source_object, GAsyncResult *res, gpointer user_data)
 {
   PhotosBaseItem *self = PHOTOS_BASE_ITEM (source_object);
-  GError *error = NULL;
+  GError *error;
   GtkWindow *toplevel = GTK_WINDOW (user_data);
   GeglNode *node;
   GtkPrintOperation *print_op = NULL;
   GtkPrintOperationResult print_res;
 
+  error = NULL;
   node = photos_base_item_load_finish (self, res, &error);
   if (error != NULL)
     {
@@ -1499,6 +1500,7 @@ photos_base_item_print_load (GObject *source_object, GAsyncResult *res, gpointer
   /* It is self managing. */
   photos_print_notification_new (print_op);
 
+  error = NULL;
   print_res = gtk_print_operation_run (print_op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, toplevel, &error);
   if (print_res == GTK_PRINT_OPERATION_RESULT_APPLY)
     {


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