[gnome-calendar] source-dialog: use g_clear_pointer



commit e6da757a352c686bbb356e6b0559d39c0dbcd75f
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]