From 28c3b67bb1f007c5ad06a9695d2d750531d2139d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 11 Jan 2011 10:33:03 +0100 Subject: Bug #638808 - camel_shutdown() called too early --- mail/e-mail-backend.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 740cf8526e..3ab7cbda8d 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -226,7 +226,6 @@ mail_backend_poll_to_quit (EActivity *activity) static void mail_backend_ready_to_quit (EActivity *activity) { - camel_shutdown (); emu_free_mail_cache (); /* Do this last. It may terminate the process. */ @@ -428,6 +427,15 @@ mail_backend_dispose (GObject *object) G_OBJECT_CLASS (e_mail_backend_parent_class)->dispose (object); } +static void +mail_backend_finalize (GObject *object) +{ + if (G_OBJECT_CLASS (e_mail_backend_parent_class)->finalize) + G_OBJECT_CLASS (e_mail_backend_parent_class)->finalize (object); + + camel_shutdown (); +} + static void mail_backend_constructed (GObject *object) { @@ -515,6 +523,7 @@ e_mail_backend_class_init (EMailBackendClass *class) object_class = G_OBJECT_CLASS (class); object_class->get_property = mail_backend_get_property; object_class->dispose = mail_backend_dispose; + object_class->finalize = mail_backend_finalize; object_class->constructed = mail_backend_constructed; shell_backend_class = E_SHELL_BACKEND_CLASS (class); -- cgit