[gnome-calendar/ui-rewrite] memory: fix memory leaks scattered around



commit 28875a81267291982f65cdd40ee25dbf3cdd2aae
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Oct 17 16:13:37 2014 -0400

    memory: fix memory leaks scattered around

 src/gcal-manager.c    |    2 ++
 src/gcal-month-view.c |    2 ++
 src/gcal-utils.c      |   14 +++++++++++---
 3 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/src/gcal-manager.c b/src/gcal-manager.c
index a7e9a24..731140f 100644
--- a/src/gcal-manager.c
+++ b/src/gcal-manager.c
@@ -160,6 +160,8 @@ thread_job_thread (gpointer user_data)
   if (tjd->func != NULL)
     tjd->func (tjd->user_data, tjd->cancellable, &tjd->error);
 
+  thread_job_data_free (tjd);
+
   return g_thread_self ();
 }
 
diff --git a/src/gcal-month-view.c b/src/gcal-month-view.c
index 7b48ade..a995c27 100644
--- a/src/gcal-month-view.c
+++ b/src/gcal-month-view.c
@@ -1062,6 +1062,7 @@ gcal_month_view_add (GtkContainer *container,
         {
           //TODO: remove once the main-dev phase its over
           g_warning ("Trying to add an event with the same uuid to the view");
+          g_free (date);
           g_object_unref (widget); /* FIXME: check if this destroy it */
           return;
         }
@@ -1408,6 +1409,7 @@ gcal_month_view_subscriber_component_added (ECalDataModelSubscriber *subscriber,
   data->event_component = e_cal_component_clone (comp);
 
   event = gcal_event_widget_new_from_data (data);
+  g_free (data);
 
   gtk_widget_show (event);
   gtk_container_add (GTK_CONTAINER (subscriber), event);
diff --git a/src/gcal-utils.c b/src/gcal-utils.c
index b64c658..116e615 100644
--- a/src/gcal-utils.c
+++ b/src/gcal-utils.c
@@ -270,13 +270,21 @@ gcal_compare_event_widget_by_date (gconstpointer a,
   icaltimetype *a_date;
   icaltimetype *b_date;
 
+  gint comparison;
+
   a_child = (GcalViewChild*) a;
   b_child = (GcalViewChild*) b;
 
-  a_date = gcal_event_widget_get_date (GCAL_EVENT_WIDGET (a_child->widget));
-  b_date = gcal_event_widget_get_date (GCAL_EVENT_WIDGET (b_child->widget));
+  a_date =
+    gcal_event_widget_get_date (GCAL_EVENT_WIDGET (a_child->widget));
+  b_date =
+    gcal_event_widget_get_date (GCAL_EVENT_WIDGET (b_child->widget));
+
+  comparison = icaltime_compare (*a_date, *b_date);
+  g_free (a_date);
+  g_free (b_date);
 
-  return icaltime_compare (*a_date, *b_date);
+  return comparison;
 }
 
 void print_date (const gchar*        prefix,


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