[evolution] migrate_mbox_to_maildir(): Fix a reference counting error.



commit c17e5b870e5c03887fa0dc158db382d827775c8c
Author: Matthew Barnes <mbarnes redhat com>
Date:   Thu Aug 9 07:10:47 2012 -0400

    migrate_mbox_to_maildir(): Fix a reference counting error.
    
    The ESourceCamel extension owns the CamelSettings instance and the
    ESource instance owns the ESourceCamel extension.  Unreference the
    ESource AFTER we're done with the CamelSettings.

 mail/e-mail-migrate.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c
index a1bf10f..e2968c1 100644
--- a/mail/e-mail-migrate.c
+++ b/mail/e-mail-migrate.c
@@ -461,16 +461,17 @@ migrate_mbox_to_maildir (EShellBackend *shell_backend,
 			CAMEL_SESSION (session), "local", "maildir",
 			CAMEL_PROVIDER_STORE, &error);
 
-	g_object_unref (source);
-
 	if (error != NULL) {
 		g_warning ("%s: %s", G_STRFUNC, error->message);
+		g_object_unref (source);
 		g_error_free (error);
 		return FALSE;
 	}
 
 	camel_service_set_settings (mbox_service, settings);
 
+	g_object_unref (source);
+
 	settings = camel_service_get_settings (maildir_service);
 	path = g_build_filename (data_dir, "local", NULL);
 	g_object_set (settings, "path", path, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]