[gnome-calendar/calendar-editor] source-dialog: use g_clear_object instead of manual free
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-editor] source-dialog: use g_clear_object instead of manual free
- Date: Wed, 6 May 2015 12:31:02 +0000 (UTC)
commit c064d20f271c856637a2ff35a8c09077346d1c42
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Wed May 6 09:30:22 2015 -0300
source-dialog: use g_clear_object instead of manual free
src/gcal-source-dialog.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 093c399..b94770f 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -357,8 +357,7 @@ back_button_clicked (GtkButton *button,
gcal_manager_save_source (priv->manager, priv->source);
// Release the source ref we acquired
- g_object_unref (priv->source);
- priv->source = NULL;
+ g_clear_object (&priv->source);
}
gcal_source_dialog_set_mode (GCAL_SOURCE_DIALOG (user_data), GCAL_SOURCE_DIALOG_MODE_NORMAL);
@@ -434,10 +433,7 @@ cancel_button_clicked (GtkWidget *button,
// Destroy the ongoing created source
if (priv->source != NULL)
- {
- g_object_unref (priv->source);
- priv->source = NULL;
- }
+ g_clear_object (&priv->source);
// Cleanup detected remote sources that weren't added
if (priv->remote_sources != NULL)
@@ -757,8 +753,7 @@ response_signal (GtkDialog *dialog,
{
gcal_manager_save_source (priv->manager, priv->source);
- g_object_unref (priv->source);
- priv->source = NULL;
+ g_clear_object (&priv->source);
}
/* commit the new source */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]