From 81dd4dc7093219b04e3e13fa9b9f7e61211d02f2 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 14 Jan 2009 12:42:52 +0000 Subject: ** Fix for bug #554454 2009-01-14 Milan Crha ** Fix for bug #554454 * gui/e-cal-model.c: (e_cal_view_objects_modified_cb): Do not crash when received 'modified' event for something not in a model. And a leak fix. svn path=/trunk/; revision=37068 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/e-cal-model.c | 9 +++++++++ 2 files changed, 17 insertions(+) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 2882432204..da6ee9b473 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,11 @@ +2009-01-14 Milan Crha + + ** Fix for bug #554454 + + * gui/e-cal-model.c: (e_cal_view_objects_modified_cb): + Do not crash when received 'modified' event for something + not in a model. And a leak fix. + 2009-01-13 Milan Crha ** Fix for bug #489437 diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 60dfd5e467..7f7fe2db02 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -1518,6 +1518,15 @@ e_cal_view_objects_modified_cb (ECalView *query, GList *objects, gpointer user_d id = e_cal_component_get_id (comp); comp_data = search_by_id_and_client (priv, client, id); + + e_cal_component_free_id (id); + g_object_unref (comp); + + if (!comp_data) { + /* the modified component is not in the model yet, just skip it */ + continue; + } + if (comp_data->icalcomp) icalcomponent_free (comp_data->icalcomp); if (comp_data->dtstart) { -- cgit v1.2.3