[gnome-calendar] quick-add-popover: Don't leak GDateTime



commit bdce9b29bae50420c97b4c09e31285e011d0eb78
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Mon Nov 9 19:24:47 2020 -0300

    quick-add-popover: Don't leak GDateTime
    
    Not sure how this went through.

 src/gui/gcal-quick-add-popover.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/gui/gcal-quick-add-popover.c b/src/gui/gcal-quick-add-popover.c
index 4a1f135f..bdb0ad75 100644
--- a/src/gui/gcal-quick-add-popover.c
+++ b/src/gui/gcal-quick-add-popover.c
@@ -216,13 +216,16 @@ select_row (GcalQuickAddPopover *self,
 static gint
 get_number_of_days_from_today (GDateTime *day)
 {
+  g_autoptr (GDateTime) now = NULL;
   GDate today, event_day;
   gint n_days;
 
+  now = g_date_time_new_now_local ();
+
   g_date_set_dmy (&today,
-                  g_date_time_get_day_of_month (g_date_time_new_now_local ()),
-                  g_date_time_get_month (g_date_time_new_now_local ()),
-                  g_date_time_get_year (g_date_time_new_now_local ()));
+                  g_date_time_get_day_of_month (now),
+                  g_date_time_get_month (now),
+                  g_date_time_get_year (now));
 
   g_date_set_dmy (&event_day,
                   g_date_time_get_day_of_month (day),


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