aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-convert-local-mail.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/e-convert-local-mail.c')
-rw-r--r--shell/e-convert-local-mail.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/shell/e-convert-local-mail.c b/shell/e-convert-local-mail.c
index 02d7e094e4..16736c95c4 100644
--- a/shell/e-convert-local-mail.c
+++ b/shell/e-convert-local-mail.c
@@ -183,8 +183,8 @@ migrate_mbox_to_maildir (EShell *shell,
ESourceRegistry *registry;
ESourceExtension *extension;
const gchar *extension_name;
- CamelService *mbox_service;
- CamelService *maildir_service;
+ CamelService *mbox_service = NULL;
+ CamelService *maildir_service = NULL;
CamelSettings *settings;
const gchar *data_dir;
const gchar *mbox_uid;
@@ -227,11 +227,18 @@ migrate_mbox_to_maildir (EShell *shell,
CAMEL_PROVIDER_STORE, &error);
if (error != NULL) {
+ if (mbox_service != NULL)
+ g_object_unref (mbox_service);
+ if (maildir_service != NULL)
+ g_object_unref (maildir_service);
g_warning ("%s: %s", G_STRFUNC, error->message);
g_error_free (error);
return FALSE;
}
+ g_return_val_if_fail (CAMEL_IS_STORE (mbox_service), FALSE);
+ g_return_val_if_fail (CAMEL_IS_STORE (maildir_service), FALSE);
+
camel_service_set_settings (mbox_service, settings);
settings = camel_service_get_settings (maildir_service);
@@ -249,6 +256,9 @@ migrate_mbox_to_maildir (EShell *shell,
while (!ms.complete)
g_main_context_iteration (NULL, TRUE);
+ g_object_unref (mbox_service);
+ g_object_unref (maildir_service);
+
return TRUE;
}