From 29a63b4a136c2c1c7f824a333e4752987ee342b7 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Mon, 21 Oct 2002 15:21:10 +0000 Subject: (e_summary_weather_reconfigure): NULL the ->weathers member before freeing the list items. Otherwise soup_message_cancel() might invoke the refresh function while we are freeing things on the list, and crash. [#31639] svn path=/trunk/; revision=18398 --- my-evolution/ChangeLog | 7 +++++++ my-evolution/e-summary-weather.c | 13 ++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) (limited to 'my-evolution') diff --git a/my-evolution/ChangeLog b/my-evolution/ChangeLog index d35630efd3..7079382892 100644 --- a/my-evolution/ChangeLog +++ b/my-evolution/ChangeLog @@ -1,3 +1,10 @@ +2002-10-21 Ettore Perazzoli + + * e-summary-weather.c (e_summary_weather_reconfigure): NULL the + ->weathers member before freeing the list items. Otherwise + soup_message_cancel() might invoke the refresh function while we + are freeing things on the list, and crash. [#31639] + 2002-09-26 Ettore Perazzoli * e-summary-mail.c (e_summary_mail_generate_html): Generate HTML diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c index 6391fa7c3e..667853a8b0 100644 --- a/my-evolution/e-summary-weather.c +++ b/my-evolution/e-summary-weather.c @@ -759,6 +759,7 @@ e_summary_weather_reconfigure (ESummary *summary) { ESummaryWeather *weather; GList *old, *p; + GList *weather_list; g_return_if_fail (summary != NULL); g_return_if_fail (IS_E_SUMMARY (summary)); @@ -768,14 +769,20 @@ e_summary_weather_reconfigure (ESummary *summary) /* Stop timeout so it doesn't occur while we're changing stuff*/ gtk_timeout_remove (weather->timeout); - for (old = weather->weathers; old; old = old->next) { + /* Clear the weather list before doing weather_free() on each of them + because otherwise soup_message_cancel() could invoke the refresh + function just while we are freeing things. [#31639] */ + weather_list = weather->weathers; + weather->weathers = NULL; + + for (old = weather_list; old != NULL; old = old->next) { Weather *w; w = old->data; weather_free (w); } - g_list_free (weather->weathers); - weather->weathers = NULL; + g_list_free (weather_list); + for (p = summary->preferences->stations; p; p = p->next) { e_summary_weather_add_location (summary, p->data); } -- cgit v1.2.3