diff options
author | Milan Crha <mcrha@redhat.com> | 2008-01-25 22:10:07 +0800 |
---|---|---|
committer | Milan Crha <mcrha@src.gnome.org> | 2008-01-25 22:10:07 +0800 |
commit | 34da45d5d6f03a24f32edf8a41a783ad489f9296 (patch) | |
tree | e8c479e2cd57bc82eae49205ef9accb0d953a479 /calendar/gui/e-day-view.c | |
parent | c4046c56365033ebc17c21f4bda6411ffe5bf1fc (diff) | |
download | gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.gz gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.tar.zst gsoc2013-evolution-34da45d5d6f03a24f32edf8a41a783ad489f9296.zip |
** Fix for bug #475781
2008-01-25 Milan Crha <mcrha@redhat.com>
** Fix for bug #475781
* plugins/save-calendar/csv-format.c: (do_save_calendar_csv):
* plugins/save-calendar/rdf-format.c: (do_save_calendar_rdf):
* plugins/itip-formatter/itip-formatter.c: (format_itip_object):
* calendar/gui/dialogs/recurrence-page.c: (fill_ending_date),
(recurrence_page_fill_widgets):
* calendar/gui/dialogs/memo-page.c: (memo_page_fill_widgets):
* calendar/gui/e-day-view.c: 2*(e_day_view_finish_long_event_resize),
2*(e_day_view_on_editing_stopped):
* calendar/gui/itip-utils.c: (comp_compliant), (reply_to_calendar_comp):
* calendar/gui/e-week-view.c: (e_week_view_on_editing_stopped):
* calendar/gui/e-calendar-view.c: (e_calendar_view_add_event),
(e_calendar_view_get_tooltips):
* calendar/gui/e-cal-component-preview.c: (write_html):
* calendar/gui/e-cal-component-memo-preview.c: (write_html):
* calendar/gui/e-cal-model.c: (add_instance_cb):
Fix memory leaks around ECalComponentDateTime.
svn path=/trunk/; revision=34895
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r-- | calendar/gui/e-day-view.c | 86 |
1 files changed, 57 insertions, 29 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 9e90ed1ea1..29468c30c8 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4969,23 +4969,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view) date.tzid = NULL; if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) { - e_cal_component_get_dtstart (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtstart (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_start_row]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } else { - e_cal_component_get_dtend (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtend (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_end_row + 1]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } e_cal_component_commit_sequence (comp); @@ -5209,23 +5217,31 @@ e_day_view_finish_long_event_resize (EDayView *day_view) date.tzid = NULL; if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_LEFT_EDGE) { - e_cal_component_get_dtstart (comp, &date); - is_date = date.value->is_date; + ECalComponentDateTime ecdt; + + e_cal_component_get_dtstart (comp, &ecdt); + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_start_row]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } else { + ECalComponentDateTime ecdt; + e_cal_component_get_dtend (comp, &date); - is_date = date.value->is_date; + is_date = ecdt.value && ecdt.value->is_date; if (!is_date) date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); dt = day_view->day_starts[day_view->resize_end_row + 1]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); + e_cal_component_free_datetime (&ecdt); + date.tzid = NULL; /* do not reuse it later */ } e_cal_component_commit_sequence (comp); @@ -7733,35 +7749,41 @@ e_day_view_on_editing_stopped (EDayView *day_view, } if (mod == CALOBJ_MOD_THIS) { - ECalComponentDateTime dt; + ECalComponentDateTime olddt, dt; - e_cal_component_get_dtstart (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtstart (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtstart (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); - e_cal_component_get_dtend (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtend (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtend (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); @@ -7890,35 +7912,41 @@ e_day_view_on_editing_stopped (EDayView *day_view, } if (mod == CALOBJ_MOD_THIS) { - ECalComponentDateTime dt; + ECalComponentDateTime olddt, dt; - e_cal_component_get_dtstart (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtstart (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtstart (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); - e_cal_component_get_dtend (comp, &dt); - if (dt.value->zone) { + e_cal_component_get_dtend (comp, &olddt); + if (olddt.value->zone) { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, - dt.value->zone); + olddt.value->is_date, + olddt.value->zone); } else { *dt.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, - dt.value->is_date, + olddt.value->is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } + dt.tzid = olddt.tzid; e_cal_component_set_dtend (comp, &dt); + dt.tzid = NULL; + e_cal_component_free_datetime (&olddt); e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); |