aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2013-02-11 23:38:29 +0800
committerMatthew Barnes <mbarnes@redhat.com>2013-02-11 23:38:29 +0800
commit3b11207dcbd01b5a18f93a406d267bb786829471 (patch)
tree0099cd20b25125d0473538126664f84526ca92ce /mail
parent60d1c3054aa60d02c763538d6b1f16d9d6ab6ade (diff)
downloadgsoc2013-evolution-3b11207dcbd01b5a18f93a406d267bb786829471.tar.gz
gsoc2013-evolution-3b11207dcbd01b5a18f93a406d267bb786829471.tar.zst
gsoc2013-evolution-3b11207dcbd01b5a18f93a406d267bb786829471.zip
Use camel_service_ref_session().
Diffstat (limited to 'mail')
-rw-r--r--mail/em-folder-properties.c13
-rw-r--r--mail/em-utils.c4
-rw-r--r--mail/mail-autofilter.c8
-rw-r--r--mail/mail-send-recv.c9
4 files changed, 25 insertions, 9 deletions
diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c
index bfbf17f245..526dc89068 100644
--- a/mail/em-folder-properties.c
+++ b/mail/em-folder-properties.c
@@ -196,7 +196,8 @@ emfp_get_folder_item (EConfig *ec,
MailFolderCache *folder_cache;
store = camel_folder_get_parent_store (context->folder);
- session = camel_service_get_session (CAMEL_SERVICE (store));
+ session = camel_service_ref_session (CAMEL_SERVICE (store));
+
folder_cache = e_mail_session_get_folder_cache (
E_MAIL_SESSION (session));
@@ -205,6 +206,8 @@ emfp_get_folder_item (EConfig *ec,
mail_folder_cache_get_folder_info_flags (
folder_cache, context->folder, &fi_flags) &&
(fi_flags & CAMEL_FOLDER_TYPE_MASK) != CAMEL_FOLDER_TYPE_INBOX;
+
+ g_object_unref (session);
}
class = G_OBJECT_GET_CLASS (context->folder);
@@ -493,7 +496,7 @@ em_folder_properties_show (CamelStore *store,
service = CAMEL_SERVICE (store);
uid = camel_service_get_uid (service);
- session = camel_service_get_session (service);
+ session = camel_service_ref_session (service);
/* Show the Edit Rule dialog for Search Folders, but not "Unmatched".
* "Unmatched" is a special Search Folder which can't be modified. */
@@ -507,7 +510,8 @@ em_folder_properties_show (CamelStore *store,
E_MAIL_SESSION (session),
folder_uri, alert_sink);
g_free (folder_uri);
- return;
+
+ goto exit;
}
}
@@ -530,4 +534,7 @@ em_folder_properties_show (CamelStore *store,
(GAsyncReadyCallback) emfp_dialog_got_folder, context);
g_object_unref (cancellable);
+
+exit:
+ g_object_unref (session);
}
diff --git a/mail/em-utils.c b/mail/em-utils.c
index b0dc4ba509..e215fa11e0 100644
--- a/mail/em-utils.c
+++ b/mail/em-utils.c
@@ -642,7 +642,7 @@ em_utils_print_messages_to_file (CamelFolder *folder,
return FALSE;
parent_store = camel_folder_get_parent_store (folder);
- session = camel_service_get_session (CAMEL_SERVICE (parent_store));
+ session = camel_service_ref_session (CAMEL_SERVICE (parent_store));
parser = e_mail_parser_new (session);
@@ -651,6 +651,8 @@ em_utils_print_messages_to_file (CamelFolder *folder,
(GAsyncReadyCallback) do_print_msg_to_file,
NULL, g_strdup (filename));
+ g_object_unref (session);
+
return TRUE;
}
diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c
index c7cefb3735..62d1f6ee92 100644
--- a/mail/mail-autofilter.c
+++ b/mail/mail-autofilter.c
@@ -422,7 +422,7 @@ mail_filter_rename_folder (CamelStore *store,
g_return_if_fail (old_folder_name != NULL);
g_return_if_fail (new_folder_name != NULL);
- session = camel_service_get_session (CAMEL_SERVICE (store));
+ session = camel_service_ref_session (CAMEL_SERVICE (store));
old_uri = e_mail_folder_uri_build (store, old_folder_name);
new_uri = e_mail_folder_uri_build (store, new_folder_name);
@@ -447,6 +447,8 @@ mail_filter_rename_folder (CamelStore *store,
g_free (old_uri);
g_free (new_uri);
+
+ g_object_unref (session);
}
void
@@ -465,7 +467,7 @@ mail_filter_delete_folder (CamelStore *store,
g_return_if_fail (folder_name != NULL);
g_return_if_fail (E_IS_ALERT_SINK (alert_sink));
- session = camel_service_get_session (CAMEL_SERVICE (store));
+ session = camel_service_ref_session (CAMEL_SERVICE (store));
uri = e_mail_folder_uri_build (store, folder_name);
@@ -525,4 +527,6 @@ mail_filter_delete_folder (CamelStore *store,
g_free (user);
g_object_unref (fc);
g_free (uri);
+
+ g_object_unref (session);
}
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index da0a1486b4..bde01abd22 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -1307,18 +1307,18 @@ mail_receive_service (CamelService *service)
g_return_if_fail (CAMEL_IS_SERVICE (service));
uid = camel_service_get_uid (service);
- session = camel_service_get_session (service);
+ session = camel_service_ref_session (service);
data = setup_send_data (E_MAIL_SESSION (session));
info = g_hash_table_lookup (data->active, uid);
if (info != NULL)
- return;
+ goto exit;
type = get_receive_type (service);
if (type == SEND_INVALID || type == SEND_SEND)
- return;
+ goto exit;
info = g_malloc0 (sizeof (*info));
info->type = type;
@@ -1374,6 +1374,9 @@ mail_receive_service (CamelService *service)
default:
g_return_if_reached ();
}
+
+exit:
+ g_object_unref (session);
}
void