diff options
| author | Milan Crha <mcrha@redhat.com> | 2011-04-18 19:15:17 +0200 |
|---|---|---|
| committer | Milan Crha <mcrha@redhat.com> | 2011-04-18 19:15:17 +0200 |
| commit | f6e5e63fb3c932f0329967210e90172db994a9c0 (patch) | |
| tree | 479f2441fb747fab69c1554587104e5c81e6890d | |
| parent | 60602e40ae30d697b6ae2c6e86e58f4619fbcbc7 (diff) | |
| download | evolution-data-server-f6e5e63fb3c932f0329967210e90172db994a9c0.tar.gz | |
Fix few memory leaks
| -rw-r--r-- | addressbook/libedata-book/e-data-book.c | 14 | ||||
| -rw-r--r-- | calendar/libecal/e-cal-component.c | 4 | ||||
| -rw-r--r-- | calendar/libecal/e-cal-util.c | 5 | ||||
| -rw-r--r-- | calendar/libedata-cal/e-data-cal-factory.c | 11 |
4 files changed, 31 insertions, 3 deletions
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c index 5495f1ebd..ccd109fac 100644 --- a/addressbook/libedata-book/e-data-book.c +++ b/addressbook/libedata-book/e-data-book.c @@ -893,6 +893,19 @@ e_data_book_dispose (GObject *object) } static void +data_book_finalize (GObject *object) +{ + EDataBook *book = E_DATA_BOOK (object); + + if (book->priv->gdbus_object) { + g_object_unref (book->priv->gdbus_object); + book->priv->gdbus_object = NULL; + } + + G_OBJECT_CLASS (e_data_book_parent_class)->finalize (object); +} + +static void e_data_book_class_init (EDataBookClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS (klass); @@ -900,6 +913,7 @@ e_data_book_class_init (EDataBookClass *klass) g_type_class_add_private (klass, sizeof (EDataBookPrivate)); object_class->dispose = e_data_book_dispose; + object_class->finalize = data_book_finalize; if (!op_pool) { op_pool = g_thread_pool_new (operation_thread, NULL, 10, FALSE, NULL); diff --git a/calendar/libecal/e-cal-component.c b/calendar/libecal/e-cal-component.c index 92f8f3543..21f8f6f43 100644 --- a/calendar/libecal/e-cal-component.c +++ b/calendar/libecal/e-cal-component.c @@ -308,9 +308,9 @@ free_icalcomponent (ECalComponent *comp, gboolean free) priv->categories = NULL; priv->classification = NULL; - priv->comment_list = NULL; + priv->comment_list = free_slist (priv->comment_list); priv->completed = NULL; - priv->contact_list = NULL; + priv->contact_list = free_slist (priv->contact_list); priv->created = NULL; priv->description_list = free_slist (priv->description_list); diff --git a/calendar/libecal/e-cal-util.c b/calendar/libecal/e-cal-util.c index b9fc1ca25..1fb404d3e 100644 --- a/calendar/libecal/e-cal-util.c +++ b/calendar/libecal/e-cal-util.c @@ -1209,7 +1209,6 @@ e_cal_util_get_component_occur_times (ECalComponent *comp, { struct icalrecurrencetype ir; ECalComponentDateTime dt_start, dt_end; - GSList *rrules = NULL, *exrules = NULL, *elem, *rdates = NULL; g_return_if_fail (comp != NULL); g_return_if_fail (start != NULL); @@ -1258,6 +1257,8 @@ e_cal_util_get_component_occur_times (ECalComponent *comp, /* ALARMS, EVENTS: DTEND and reccurences */ if (e_cal_component_has_recurrences (comp)) { + GSList *rrules = NULL, *exrules = NULL, *elem, *rdates = NULL; + /* Do the RRULEs, EXRULEs and RDATEs*/ e_cal_component_get_rrule_property_list (comp, &rrules); e_cal_component_get_exrule_property_list (comp, &exrules); @@ -1316,6 +1317,8 @@ e_cal_util_get_component_occur_times (ECalComponent *comp, else if (rdate_end > *end) *end = rdate_end; } + + e_cal_component_free_period_list (rdates); } /* Get dtend of the component and convert it to UTC */ diff --git a/calendar/libedata-cal/e-data-cal-factory.c b/calendar/libedata-cal/e-data-cal-factory.c index f67594078..0b02e42a4 100644 --- a/calendar/libedata-cal/e-data-cal-factory.c +++ b/calendar/libedata-cal/e-data-cal-factory.c @@ -578,6 +578,7 @@ static void e_data_cal_factory_finalize (GObject *object) { EDataCalFactory *factory = E_DATA_CAL_FACTORY (object); + gint ii; g_return_if_fail (factory != NULL); @@ -592,6 +593,16 @@ e_data_cal_factory_finalize (GObject *object) g_mutex_free (factory->priv->backends_mutex); + for (ii = 0; ii < E_CAL_SOURCE_TYPE_LAST; ii++) { + if (factory->priv->lists[ii]) { + g_object_unref (factory->priv->lists[ii]); + factory->priv->lists[ii] = NULL; + } + + g_slist_free (factory->priv->backends_by_type[ii]); + factory->priv->backends_by_type[ii] = NULL; + } + /* Chain up to parent's finalize() method. */ G_OBJECT_CLASS (e_data_cal_factory_parent_class)->finalize (object); } |
