aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/mail-component.c12
-rw-r--r--mail/mail-send-recv.c4
-rw-r--r--mail/mail-send-recv.h4
4 files changed, 23 insertions, 9 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 308baf6960..ff0e89fff5 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,15 @@
+2008-09-08 Milan Crha <mcrha@redhat.com>
+
+ ** Fix for bug #328216
+
+ * mail-send-recv.h: (mail_autoreceive_init):
+ * mail-send-recv.c: (mail_autoreceive_init):
+ * mail-component.c: (mail_component_init): Pass 'session' as parameter
+ to the 'mail_autoreceive_init' to not create two MailComponents.
+ * mail-component.c: (impl_finalize): Do not free pointer twice.
+ * mail-component.c: (impl_finalize), (impl_quit): Call shutdown in time
+ of quit to shutdown camel, which will store changes in 'camel-cert.db'.
+
2008-09-05 Srinivasa Ragavan <sragavan@novell.com>
* mail-folder-cache.c (real_flush_updates): Fix infinite loop on
diff --git a/mail/mail-component.c b/mail/mail-component.c
index 2704442bc7..bbb4f7e971 100644
--- a/mail/mail-component.c
+++ b/mail/mail-component.c
@@ -490,8 +490,6 @@ impl_finalize (GObject *object)
g_free (priv->base_directory);
- mail_async_event_destroy (priv->async_event);
-
g_hash_table_destroy (priv->store_hash);
if (mail_async_event_destroy (priv->async_event) == -1) {
@@ -505,8 +503,6 @@ impl_finalize (GObject *object)
g_object_unref (priv->logger);
g_free (priv);
- mail_session_shutdown ();
-
(* G_OBJECT_CLASS (parent_class)->finalize) (object);
}
@@ -902,7 +898,11 @@ impl_quit(PortableServer_Servant servant, CORBA_Environment *ev)
/* Falls through */
case MC_QUIT_THREADS:
/* should we keep cancelling? */
- return !mail_msg_active((unsigned int)-1);
+ if (mail_msg_active((unsigned int)-1))
+ return FALSE;
+
+ mail_session_shutdown ();
+ return TRUE;
}
return TRUE;
@@ -1301,7 +1301,7 @@ mail_component_init (MailComponent *component)
(GDestroyNotify) NULL,
(GDestroyNotify) store_hash_free);
- mail_autoreceive_init();
+ mail_autoreceive_init (session);
priv->mail_sync_in_progress = 0;
if (g_getenv("CAMEL_FLUSH_CHANGES"))
diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c
index 588d1287ae..139bc2dc25 100644
--- a/mail/mail-send-recv.c
+++ b/mail/mail-send-recv.c
@@ -1061,7 +1061,7 @@ auto_online(CamelObject *o, void *ed, void *d)
/* call to setup initial, and after changes are made to the config */
/* FIXME: Need a cleanup funciton for when object is deactivated */
void
-mail_autoreceive_init(void)
+mail_autoreceive_init (CamelSession *session)
{
EAccountList *accounts;
EIterator *iter;
@@ -1079,7 +1079,7 @@ mail_autoreceive_init(void)
for (iter = e_list_get_iterator((EList *)accounts);e_iterator_is_valid(iter);e_iterator_next(iter))
auto_account_added(accounts, (EAccount *)e_iterator_get(iter), NULL);
- camel_object_hook_event(mail_component_peek_session(NULL), "online", auto_online, NULL);
+ camel_object_hook_event (session, "online", auto_online, NULL);
}
/* we setup the download info's in a hashtable, if we later need to build the gui, we insert
diff --git a/mail/mail-send-recv.h b/mail/mail-send-recv.h
index f8351f7310..8d8e4bbde2 100644
--- a/mail/mail-send-recv.h
+++ b/mail/mail-send-recv.h
@@ -31,13 +31,15 @@ extern "C" {
#pragma }
#endif /* __cplusplus */
+struct _CamelSession;
+
/* send/receive all uri's */
GtkWidget *mail_send_receive(void);
/* receive a single uri */
void mail_receive_uri(const char *uri, int keep);
void mail_send (void);
/* setup auto receive stuff */
-void mail_autoreceive_init(void);
+void mail_autoreceive_init (struct _CamelSession *session);
#ifdef __cplusplus
}