diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-01-31 05:05:49 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-01-31 05:05:49 +0800 |
commit | af2899875563337fe95a6fed42275aeeb74686a4 (patch) | |
tree | 584e01e19c3d5a8dbb29d49b7581df179cb63220 | |
parent | ad7a9ca25a462854ac5aac2adcc628b83ee3ee51 (diff) | |
download | gsoc2013-evolution-af2899875563337fe95a6fed42275aeeb74686a4.tar.gz gsoc2013-evolution-af2899875563337fe95a6fed42275aeeb74686a4.tar.zst gsoc2013-evolution-af2899875563337fe95a6fed42275aeeb74686a4.zip |
Protect against multiple camel_init() calls. Remember if we've already
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.
svn path=/trunk/; revision=24547
-rw-r--r-- | camel/ChangeLog | 5 | ||||
-rw-r--r-- | camel/camel.c | 12 |
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; } |