aboutsummaryrefslogtreecommitdiffstats
path: root/libemail-engine
diff options
context:
space:
mode:
Diffstat (limited to 'libemail-engine')
-rw-r--r--libemail-engine/e-mail-folder-utils.c4
-rw-r--r--libemail-engine/e-mail-session.c10
-rw-r--r--libemail-engine/mail-ops.c5
-rw-r--r--libemail-engine/mail-tools.c11
4 files changed, 22 insertions, 8 deletions
diff --git a/libemail-engine/e-mail-folder-utils.c b/libemail-engine/e-mail-folder-utils.c
index 78e5434ed9..5d4fa2e2b1 100644
--- a/libemail-engine/e-mail-folder-utils.c
+++ b/libemail-engine/e-mail-folder-utils.c
@@ -313,7 +313,7 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
CAMEL_SESSION (session), source_uid);
service_uid = camel_service_get_uid (service);
- settings = camel_service_get_settings (service);
+ settings = camel_service_ref_settings (service);
g_object_get (
settings,
@@ -321,6 +321,8 @@ mail_folder_expunge_pop3_stores (CamelFolder *folder,
"keep-on-server", &keep_on_server,
NULL);
+ g_object_unref (settings);
+
if (!keep_on_server || !delete_expunged) {
g_object_unref (service);
continue;
diff --git a/libemail-engine/e-mail-session.c b/libemail-engine/e-mail-session.c
index c7853f9b56..a2f56814cf 100644
--- a/libemail-engine/e-mail-session.c
+++ b/libemail-engine/e-mail-session.c
@@ -688,14 +688,18 @@ mail_session_configure_local_store (EMailSession *session)
session->priv->local_store = service; /* takes ownership */
g_return_if_fail (service != NULL);
- settings = camel_service_get_settings (service);
- local_settings = CAMEL_LOCAL_SETTINGS (settings);
- data_dir = camel_session_get_user_data_dir (camel_session);
+ settings = camel_service_ref_settings (service);
+ data_dir = camel_session_get_user_data_dir (camel_session);
path = g_build_filename (data_dir, E_MAIL_SESSION_LOCAL_UID, NULL);
+
+ local_settings = CAMEL_LOCAL_SETTINGS (settings);
camel_local_settings_set_path (local_settings, path);
+
g_free (path);
+ g_object_unref (settings);
+
/* Shouldn't need to worry about other mail applications
* altering files in our local mail store. */
g_object_set (service, "need-summary-check", FALSE, NULL);
diff --git a/libemail-engine/mail-ops.c b/libemail-engine/mail-ops.c
index 7120826d49..ed3f44264d 100644
--- a/libemail-engine/mail-ops.c
+++ b/libemail-engine/mail-ops.c
@@ -249,13 +249,16 @@ fetch_mail_exec (struct _fetch_mail_msg *m,
service = CAMEL_SERVICE (m->store);
uid = camel_service_get_uid (service);
- settings = camel_service_get_settings (service);
+
+ settings = camel_service_ref_settings (service);
/* XXX This is a POP3-specific setting. */
class = G_OBJECT_GET_CLASS (settings);
if (g_object_class_find_property (class, "keep-on-server") != NULL)
g_object_get (settings, "keep-on-server", &keep, NULL);
+ g_object_unref (settings);
+
/* Just for readability. */
delete_fetched = !keep;
diff --git a/libemail-engine/mail-tools.c b/libemail-engine/mail-tools.c
index 82b2146b92..29955c73d4 100644
--- a/libemail-engine/mail-tools.c
+++ b/libemail-engine/mail-tools.c
@@ -91,7 +91,7 @@ mail_tool_do_movemail (CamelStore *store,
CamelService *service;
CamelProvider *provider;
CamelSettings *settings;
- const gchar *src_path;
+ gchar *src_path;
gchar *dest_path;
struct stat sb;
gboolean success;
@@ -100,7 +100,6 @@ mail_tool_do_movemail (CamelStore *store,
service = CAMEL_SERVICE (store);
provider = camel_service_get_provider (service);
- settings = camel_service_get_settings (service);
g_return_val_if_fail (provider != NULL, NULL);
@@ -114,9 +113,13 @@ mail_tool_do_movemail (CamelStore *store,
return NULL;
}
- src_path = camel_local_settings_get_path (
+ settings = camel_service_ref_settings (service);
+
+ src_path = camel_local_settings_dup_path (
CAMEL_LOCAL_SETTINGS (settings));
+ g_object_unref (settings);
+
/* Set up our destination. */
dest_path = mail_tool_get_local_movemail_path (store, error);
if (dest_path == NULL)
@@ -125,6 +128,8 @@ mail_tool_do_movemail (CamelStore *store,
/* Movemail from source to dest_path */
success = camel_movemail (src_path, dest_path, error) != -1;
+ g_free (src_path);
+
if (g_stat (dest_path, &sb) < 0 || sb.st_size == 0) {
g_unlink (dest_path); /* Clean up the movemail.foo file. */
g_free (dest_path);