aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog5
-rw-r--r--camel/camel.c12
2 files changed, 17 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index 3753da6f32..61f0bb0124 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,8 @@
+2004-01-30 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel.c (camel_init): Protect against multiple camel_init()
+ calls. Remember if we've already been called.
+
2004-01-30 Not Zed <NotZed@Ximian.com>
* camel-store.c (camel_store_rename_folder): copy the old_name
diff --git a/camel/camel.c b/camel/camel.c
index ae99da74c2..8d60968705 100644
--- a/camel/camel.c
+++ b/camel/camel.c
@@ -41,11 +41,16 @@
gboolean camel_verbose_debug = FALSE;
+static int initialised = FALSE;
+
static void
camel_shutdown (void)
{
CamelCertDB *certdb;
+ if (!initialised)
+ return;
+
#ifdef HAVE_NSS
NSS_Shutdown ();
@@ -57,6 +62,8 @@ camel_shutdown (void)
camel_certdb_save (certdb);
camel_object_unref (certdb);
}
+
+ initialised = FALSE;
}
int
@@ -66,6 +73,9 @@ camel_init (const char *configdir, gboolean nss_init)
char *path;
void camel_operation_init(void);
+ if (initialised)
+ return;
+
if (getenv ("CAMEL_VERBOSE_DEBUG"))
camel_verbose_debug = TRUE;
@@ -111,5 +121,7 @@ camel_init (const char *configdir, gboolean nss_init)
g_atexit (camel_shutdown);
+ initialised = TRUE;
+
return 0;
}