[evolution/gnome-3-4] Fix few more memory leaks
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-3-4] Fix few more memory leaks
- Date: Fri, 20 Jul 2012 16:15:35 +0000 (UTC)
commit bb1817a21e7dd1802ddce12b64f29aa237a959b1
Author: Milan Crha <mcrha redhat com>
Date: Fri Jul 20 18:15:02 2012 +0200
Fix few more memory leaks
mail/mail-send-recv.c | 15 +++++++++++++--
mail/message-list.c | 14 ++++++++++----
modules/mail/e-mail-shell-sidebar.c | 2 ++
3 files changed, 25 insertions(+), 6 deletions(-)
---
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index a2b6027..2822bcb 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -897,10 +897,21 @@ receive_done (int still_more, gpointer data)
/* 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 2b77c96..fe0106e 100644
--- a/mail/message-list.c
+++ b/mail/message-list.c
@@ -2668,11 +2668,8 @@ message_list_dispose (GObject *object)
if (message_list->folder) {
mail_regen_cancel (message_list);
- if (message_list->uid_nodemap) {
+ if (message_list->uid_nodemap)
g_hash_table_foreach (message_list->uid_nodemap, (GHFunc) clear_info, message_list);
- g_hash_table_destroy (message_list->uid_nodemap);
- message_list->uid_nodemap = NULL;
- }
g_signal_handlers_disconnect_by_func (
message_list->folder, folder_changed, message_list);
@@ -2680,6 +2677,11 @@ message_list_dispose (GObject *object)
message_list->folder = NULL;
}
+ if (message_list->uid_nodemap) {
+ g_hash_table_destroy (message_list->uid_nodemap);
+ message_list->uid_nodemap = NULL;
+ }
+
if (priv->invisible) {
g_object_unref (priv->invisible);
priv->invisible = NULL;
@@ -3883,6 +3885,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;
}
diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c
index 857a0d6..2c2cdfb 100644
--- a/modules/mail/e-mail-shell-sidebar.c
+++ b/modules/mail/e-mail-shell-sidebar.c
@@ -73,6 +73,8 @@ mail_shell_sidebar_selection_changed_cb (EShellSidebar *shell_sidebar,
if (is_folder)
icon_name = em_folder_utils_get_icon_name (flags);
else {
+ g_free (display_name);
+
icon_name = shell_view_class->icon_name;
display_name = g_strdup (shell_view_class->label);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]