[gnome-calendar/calendar-editor] source-dialog: use g_clear_pointer



commit a7711c33249fcfbbccbb81a28eea3b7cc3b873ae
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Feb 23 14:17:32 2015 -0300

    source-dialog: use g_clear_pointer

 src/gcal-source-dialog.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 1f0e2b3..d1f7dc1 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -312,16 +312,10 @@ response_signal (GtkDialog *dialog,
   if (priv->mode == GCAL_SOURCE_DIALOG_MODE_CREATE && response_id == GTK_RESPONSE_CANCEL)
     {
       if (priv->local_source != NULL)
-        {
-          g_object_unref (priv->local_source);
-          priv->local_source = NULL;
-        }
+        g_clear_object (&(priv->local_source));
 
       if (priv->remote_source != NULL)
-        {
-          g_object_unref (priv->remote_source);
-          priv->remote_source = NULL;
-        }
+        g_clear_object (&(priv->remote_source));
     }
 }
 


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