aboutsummaryrefslogtreecommitdiffstats
path: root/my-evolution/e-summary-weather.c
diff options
context:
space:
mode:
authorIain Holmes <iain@src.gnome.org>2001-07-12 03:08:53 +0800
committerIain Holmes <iain@src.gnome.org>2001-07-12 03:08:53 +0800
commit76d4c1fa56ec4c02d68ad39ac847890936a4c098 (patch)
treeb3f2f7881d6bd7a97ea4dd11d47e8b1fbfbeb835 /my-evolution/e-summary-weather.c
parent127cae25a2bcb06343cda67831bcbb851cd56dad (diff)
downloadgsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar.gz
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar.bz2
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar.lz
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar.xz
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.tar.zst
gsoc2013-evolution-76d4c1fa56ec4c02d68ad39ac847890936a4c098.zip
Free the data stop all the transfers when the summary is destroyed.
svn path=/trunk/; revision=11010
Diffstat (limited to 'my-evolution/e-summary-weather.c')
-rw-r--r--my-evolution/e-summary-weather.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/my-evolution/e-summary-weather.c b/my-evolution/e-summary-weather.c
index 47d077212a..a2b3d5ffe3 100644
--- a/my-evolution/e-summary-weather.c
+++ b/my-evolution/e-summary-weather.c
@@ -229,14 +229,18 @@ close_callback (GnomeVFSAsyncHandle *handle,
if (w->handle == NULL) {
g_free (w->buffer);
+ w->buffer = NULL;
g_string_free (w->string, TRUE);
+ w->string = NULL;
return;
}
w->handle = NULL;
g_free (w->buffer);
+ w->buffer = NULL;
html = w->string->str;
g_string_free (w->string, FALSE);
+ w->string = NULL;
/* Find the metar data */
search_str = g_strdup_printf ("\n%s", w->location);
@@ -335,10 +339,18 @@ weather_free (Weather *w)
if (w->handle != NULL) {
gnome_vfs_async_cancel (w->handle);
}
+ if (w->string) {
+ g_string_free (w->string, TRUE);
+ }
+ if (w->buffer) {
+ g_free (w->buffer);
+ }
+
g_free (w->location);
g_free (w->html);
g_free (w);
}
+
static void
e_summary_weather_add_location (ESummary *summary,
const char *location)
@@ -729,3 +741,33 @@ e_summary_weather_reconfigure (ESummary *summary)
(GtkFunction) e_summary_weather_update, summary);
e_summary_weather_update (summary);
}
+
+void
+e_summary_weather_free (ESummary *summary)
+{
+ ESummaryWeather *weather;
+ GList *p;
+
+ g_return_if_fail (summary != NULL);
+ g_return_if_fail (IS_E_SUMMARY (summary));
+
+ weather = summary->weather;
+
+ if (weather->timeout != 0) {
+ gtk_timeout_remove (weather->timeout);
+ }
+ for (p = weather->weathers; p; p = p->next) {
+ Weather *w = p->data;
+
+ weather_free (w);
+ }
+ g_list_free (weather->weathers);
+ g_free (weather->html);
+
+ e_summary_remove_online_connection (summary, weather->connection);
+ g_free (weather->connection);
+
+ g_free (weather);
+ summary->weather = NULL;
+}
+