[evolution-exchange] Bug #620815 - Memory leaks with Evolution
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-exchange] Bug #620815 - Memory leaks with Evolution
- Date: Thu, 24 Jun 2010 18:44:42 +0000 (UTC)
commit af5483d01831c92d6b580b3e0bc5a46f588adaac
Author: Milan Crha <mcrha redhat com>
Date: Thu Jun 24 20:44:14 2010 +0200
Bug #620815 - Memory leaks with Evolution
camel/camel-exchange-folder.c | 19 +++----------------
camel/camel-exchange-summary.c | 2 +-
2 files changed, 4 insertions(+), 17 deletions(-)
---
diff --git a/camel/camel-exchange-folder.c b/camel/camel-exchange-folder.c
index ccc60f3..0b3abae 100644
--- a/camel/camel-exchange-folder.c
+++ b/camel/camel-exchange-folder.c
@@ -296,13 +296,6 @@ exchange_folder_cache_xfer (CamelExchangeFolder *folder_source,
}
static void
-free_index_and_mid (gpointer thread_index, gpointer message_id, gpointer d)
-{
- g_free (thread_index);
- g_free (message_id);
-}
-
-static void
exchange_folder_dispose (GObject *object)
{
CamelExchangeFolder *exch = CAMEL_EXCHANGE_FOLDER (object);
@@ -321,12 +314,8 @@ exchange_folder_finalize (GObject *object)
{
CamelExchangeFolder *exch = CAMEL_EXCHANGE_FOLDER (object);
- if (exch->thread_index_to_message_id) {
- g_hash_table_foreach (
- exch->thread_index_to_message_id,
- free_index_and_mid, NULL);
+ if (exch->thread_index_to_message_id)
g_hash_table_destroy (exch->thread_index_to_message_id);
- }
g_free (exch->source);
@@ -880,8 +869,6 @@ camel_exchange_folder_remove_message (CamelExchangeFolder *exch,
einfo->thread_index,
&key, &value)) {
g_hash_table_remove (exch->thread_index_to_message_id, key);
- g_free (key);
- g_free (value);
}
}
@@ -1091,7 +1078,7 @@ camel_exchange_folder_construct (CamelFolder *folder,
camel_object_state_read (CAMEL_OBJECT (folder));
exch->thread_index_to_message_id =
- g_hash_table_new (g_str_hash, g_str_equal);
+ g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
len = camel_folder_summary_count (folder->summary);
for (i = 0; i < len; i++) {
@@ -1121,7 +1108,7 @@ camel_exchange_folder_construct (CamelFolder *folder,
g_ptr_array_set_size (hrefs, summary->len);
for (i = 0; i < summary->len; i++) {
- uids->pdata[i] = g_strdup(summary->pdata[i]);
+ uids->pdata[i] = summary->pdata[i];
info = camel_folder_summary_uid (folder->summary, uids->pdata[i]);
flags->data[i] = ((CamelMessageInfoBase *)info)->flags & CAMEL_EXCHANGE_SERVER_FLAGS;
hrefs->pdata[i] = ((CamelExchangeMessageInfo *)info)->href;
diff --git a/camel/camel-exchange-summary.c b/camel/camel-exchange-summary.c
index 59b7c0d..aa9e1fd 100644
--- a/camel/camel-exchange-summary.c
+++ b/camel/camel-exchange-summary.c
@@ -321,7 +321,7 @@ exchange_summary_message_info_from_db (CamelFolderSummary *s,
info = folder_summary_class->message_info_from_db (s, mir);
if (info) {
- gchar *part = g_strdup (mir->bdata);
+ gchar *part = mir->bdata;
gint len;
einfo = (CamelExchangeMessageInfo *)info;
EXTRACT_FIRST_STRING (einfo->thread_index)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]