[gnome-calendar] event-widget: fixed memory leak



commit bddf1d210449137ca249d10759d175f4f96a3acb
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Fri Oct 17 00:50:16 2014 -0400

    event-widget: fixed memory leak
    
    Each property was owned by the widget, and I was not freeing its memory
    at destruction time

 src/gcal-event-widget.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/gcal-event-widget.c b/src/gcal-event-widget.c
index e43e71b..08564c9 100644
--- a/src/gcal-event-widget.c
+++ b/src/gcal-event-widget.c
@@ -337,6 +337,22 @@ gcal_event_widget_finalize (GObject *object)
   if (priv->component != NULL)
     g_object_unref (priv->component);
 
+  /* releasing properties */
+  if (priv->uuid != NULL)
+    g_free (priv->uuid);
+
+  if (priv->summary != NULL)
+    g_free (priv->summary);
+
+  if (priv->color != NULL)
+    gdk_rgba_free (priv->color);
+
+  if (priv->dt_start != NULL)
+    g_free (priv->dt_start);
+
+  if (priv->dt_end != NULL)
+    g_free (priv->dt_end);
+
   G_OBJECT_CLASS (gcal_event_widget_parent_class)->finalize (object);
 }
 


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