[evolution-data-server/gnome-3-22] Fix a ref/unref imbalance of CamelIMAPXStoreInfo
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/gnome-3-22] Fix a ref/unref imbalance of CamelIMAPXStoreInfo
- Date: Fri, 27 Jan 2017 10:05:27 +0000 (UTC)
commit 95ad14a2ed827a8bd4e8cd9af7ba45679e2ae899
Author: Milan Crha <mcrha redhat com>
Date: Fri Jan 27 11:06:31 2017 +0100
Fix a ref/unref imbalance of CamelIMAPXStoreInfo
camel/providers/imapx/camel-imapx-store-summary.c | 9 +++++----
camel/providers/imapx/camel-imapx-store.c | 4 ++++
2 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/camel/providers/imapx/camel-imapx-store-summary.c
b/camel/providers/imapx/camel-imapx-store-summary.c
index ef58f6d..be37480 100644
--- a/camel/providers/imapx/camel-imapx-store-summary.c
+++ b/camel/providers/imapx/camel-imapx-store-summary.c
@@ -325,6 +325,8 @@ camel_imapx_store_summary_mailbox (CamelStoreSummary *summary,
return (CamelIMAPXStoreInfo *) match;
}
+/* The returned CamelIMAPXStoreInfo is referenced, unref it with
+ camel_store_summary_info_unref() when no longer needed */
CamelIMAPXStoreInfo *
camel_imapx_store_summary_add_from_mailbox (CamelStoreSummary *summary,
CamelIMAPXMailbox *mailbox)
@@ -341,11 +343,8 @@ camel_imapx_store_summary_add_from_mailbox (CamelStoreSummary *summary,
separator = camel_imapx_mailbox_get_separator (mailbox);
info = camel_imapx_store_summary_mailbox (summary, mailbox_name);
- if (info != NULL) {
- camel_store_summary_info_unref (
- summary, (CamelStoreInfo *) info);
+ if (info != NULL)
return info;
- }
folder_path = camel_imapx_mailbox_to_folder_path (
mailbox_name, separator);
@@ -357,6 +356,8 @@ camel_imapx_store_summary_add_from_mailbox (CamelStoreSummary *summary,
g_return_val_if_fail (info != NULL, NULL);
+ camel_store_summary_info_ref (summary, (CamelStoreInfo *) info);
+
info->mailbox_name = g_strdup (mailbox_name);
info->separator = separator;
diff --git a/camel/providers/imapx/camel-imapx-store.c b/camel/providers/imapx/camel-imapx-store.c
index f358816..d00b103 100644
--- a/camel/providers/imapx/camel-imapx-store.c
+++ b/camel/providers/imapx/camel-imapx-store.c
@@ -468,6 +468,8 @@ imapx_store_process_mailbox_attributes (CamelIMAPXStore *store,
folder_path = camel_imapx_mailbox_to_folder_path (mailbox_name, separator);
fi = imapx_store_build_folder_info (store, folder_path, (CamelFolderInfoFlags) flags);
+ camel_store_summary_info_unref (store->summary, (CamelStoreInfo *) si);
+
/* Figure out which signals to emit, if any. */
if (use_subscriptions || camel_imapx_namespace_get_category (camel_imapx_mailbox_get_namespace
(mailbox)) != CAMEL_IMAPX_NAMESPACE_PERSONAL) {
/* If we are honoring folder subscriptions, then
@@ -1218,6 +1220,8 @@ collect_folder_info_for_list (CamelIMAPXStore *imapx_store,
/* Takes ownership of the CamelFolderInfo. */
g_hash_table_insert (folder_info_results, g_strdup (mailbox_name), fi);
+
+ camel_store_summary_info_unref (imapx_store->summary, (CamelStoreInfo *) si);
}
static gboolean
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]