aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2012-07-21 00:13:49 +0800
committerMilan Crha <mcrha@redhat.com>2012-07-21 00:14:38 +0800
commit84025c02ebe79b8477be528e37d48546b5370651 (patch)
treef6941ed9ee97ec73c4575d874d64c7439c3593c3
parent6edec8cefcffc5d46c63a0e0fa70be1fb4ed2926 (diff)
downloadgsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar.gz
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar.bz2
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar.lz
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar.xz
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.tar.zst
gsoc2013-evolution-84025c02ebe79b8477be528e37d48546b5370651.zip
Fix few more memory leaks
-rw-r--r--mail/mail-send-recv.c15
-rw-r--r--mail/message-list.c4
2 files changed, 17 insertions, 2 deletions
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index a8bade95a1..0d2cc10d00 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -881,10 +881,21 @@ receive_done (gint still_more,
/* remove/free this active download */
d(printf("%s: freeing info %p\n", G_STRFUNC, info));
- if (info->type == SEND_SEND)
+ if (info->type == SEND_SEND) {
+ gpointer key = NULL, value = NULL;
+ if (!g_hash_table_lookup_extended (info->data->active, SEND_URI_KEY, &key, &value))
+ key = NULL;
+
g_hash_table_steal (info->data->active, SEND_URI_KEY);
- else
+ g_free (key);
+ } else {
+ gpointer key = NULL, value = NULL;
+ if (!g_hash_table_lookup_extended (info->data->active, uid, &key, &value))
+ key = NULL;
+
g_hash_table_steal (info->data->active, uid);
+ g_free (key);
+ }
info->data->infos = g_list_remove (info->data->infos, info);
if (g_hash_table_size (info->data->active) == 0) {
diff --git a/mail/message-list.c b/mail/message-list.c
index 997e38d12a..7cce5f9899 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -3908,6 +3908,10 @@ message_list_set_folder (MessageList *message_list,
if (message_list->folder) {
g_signal_handlers_disconnect_by_func (
message_list->folder, folder_changed, message_list);
+
+ if (message_list->uid_nodemap)
+ g_hash_table_foreach (message_list->uid_nodemap, (GHFunc) clear_info, message_list);
+
g_object_unref (message_list->folder);
message_list->folder = NULL;
}