aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/calendar-component.c
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <poincare@ikezoe.net>2007-07-26 20:37:57 +0800
committerHiroyuki Ikezoe <hiikezoe@src.gnome.org>2007-07-26 20:37:57 +0800
commit7193b99f7ae278d58bc06c0322d8c12eddaf2df6 (patch)
treefc69a4b1a5d3b18a4707c6c775983d490399d42b /calendar/gui/calendar-component.c
parent0aa26a1e49d1595f0e250982dd3e13f82323efbc (diff)
downloadgsoc2013-evolution-7193b99f7ae278d58bc06c0322d8c12eddaf2df6.tar.gz
gsoc2013-evolution-7193b99f7ae278d58bc06c0322d8c12eddaf2df6.tar.zst
gsoc2013-evolution-7193b99f7ae278d58bc06c0322d8c12eddaf2df6.zip
Plugged memory leaks.
2007-07-26 Hiroyuki Ikezoe <poincare@ikezoe.net> * gui/alarm-notify/config-data.c, gui/tasks-component.c, gui/calendar-component.c, gui/memos-component.c: Plugged memory leaks. svn path=/trunk/; revision=33852
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r--calendar/gui/calendar-component.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index f077199fa6..38bd178156 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -241,12 +241,14 @@ ensure_sources (CalendarComponent *component)
if (!personal_source) {
char *primary_calendar = calendar_config_get_primary_calendar();
+ GSList *calendars_selected;
/* Create the default Person addressbook */
personal_source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI);
e_source_group_add_source (on_this_computer, personal_source, -1);
- if (!primary_calendar && !calendar_config_get_calendars_selected ()) {
+ calendars_selected = calendar_config_get_calendars_selected ();
+ if (!primary_calendar && !calendars_selected) {
GSList selected;
calendar_config_set_primary_calendar (e_source_peek_uid (personal_source));
@@ -256,6 +258,11 @@ ensure_sources (CalendarComponent *component)
calendar_config_set_calendars_selected (&selected);
}
+ if (calendars_selected) {
+ g_slist_foreach (calendars_selected, (GFunc) g_free, NULL);
+ g_slist_free (calendars_selected);
+ }
+
g_free (primary_calendar);
e_source_set_color_spec (personal_source, "#BECEDD");
}
@@ -465,6 +472,11 @@ update_task_memo_selection (CalendarComponentView *component_view, ECalSourceTyp
component_view->task_source_selection = uids_selected;
else
component_view->memo_source_selection = uids_selected;
+
+ if (uids_selected) {
+ g_slist_foreach (uids_selected, (GFunc) g_free, NULL);
+ g_slist_free (uids_selected);
+ }
}
static void