[gnome-calendar] window: use g_clear_pointer instead of g_date_time_unref
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] window: use g_clear_pointer instead of g_date_time_unref
- Date: Sun, 28 Feb 2016 17:13:31 +0000 (UTC)
commit af6f2141abc73be6292c8517143e4b73b73bc061
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sun Feb 28 14:11:09 2016 -0300
window: use g_clear_pointer instead of g_date_time_unref
This would handle the case where the datetime is NULL for us.
src/gcal-window.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index db56c0b..7bcadbd 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -667,8 +667,8 @@ show_new_event_widget (GcalView *view,
if (window->event_creation_data != NULL)
{
- g_date_time_unref (window->event_creation_data->start_date);
- g_date_time_unref (window->event_creation_data->end_date);
+ g_clear_pointer (&window->event_creation_data->start_date, g_date_time_unref);
+ g_clear_pointer (&window->event_creation_data->end_date, g_date_time_unref);
g_free (window->event_creation_data);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]