Always set a g_atexit handler to flush/save the camel-certdb.
authorJeffrey Stedfast <fejj@ximian.com>
Mon, 5 Aug 2002 20:04:05 +0000 (20:04 +0000)
committerJeffrey Stedfast <fejj@src.gnome.org>
Mon, 5 Aug 2002 20:04:05 +0000 (20:04 +0000)
2002-08-05  Jeffrey Stedfast  <fejj@ximian.com>

* camel.c (camel_init): Always set a g_atexit handler to
flush/save the camel-certdb.

camel/ChangeLog
camel/camel.c

index 787f16f..d04a0e4 100644 (file)
@@ -1,5 +1,8 @@
 2002-08-05  Jeffrey Stedfast  <fejj@ximian.com>
 
+       * camel.c (camel_init): Always set a g_atexit handler to
+       flush/save the camel-certdb.
+
        * providers/imap/camel-imap-store.c (get_folder_info_online): If
        we are asking for the toplevel folders, use the IMAP store's
        namespace as the toplevel folder rather than an empty
index 7b250a1..c62656d 100644 (file)
 
 gboolean camel_verbose_debug = FALSE;
 
-#ifdef HAVE_NSS
 static void
 camel_shutdown (void)
 {
        CamelCertDB *certdb;
        
+#ifdef HAVE_NSS
        NSS_Shutdown ();
        
        PR_Cleanup ();
+#endif /* HAVE_NSS */
        
        certdb = camel_certdb_get_default ();
        if (certdb) {
@@ -57,7 +58,6 @@ camel_shutdown (void)
                camel_object_unref (certdb);
        }
 }
-#endif /* HAVE_NSS */
 
 gint
 camel_init (const char *configdir, gboolean nss_init)
@@ -75,10 +75,10 @@ camel_init (const char *configdir, gboolean nss_init)
        
        if (getenv ("CAMEL_VERBOSE_DEBUG"))
                camel_verbose_debug = TRUE;
-
+       
        /* initialise global camel_object_type */
        camel_object_get_type();
-
+       
        camel_mime_utils_init();
        
 #ifdef HAVE_NSS
@@ -95,13 +95,11 @@ camel_init (const char *configdir, gboolean nss_init)
                
                NSS_SetDomesticPolicy ();
                
-               g_atexit (camel_shutdown);
+               SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE);
+               SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE);
+               SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE);
+               SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */);
        }
-       
-       SSL_OptionSetDefault (SSL_ENABLE_SSL2, PR_TRUE);
-       SSL_OptionSetDefault (SSL_ENABLE_SSL3, PR_TRUE);
-       SSL_OptionSetDefault (SSL_ENABLE_TLS, PR_TRUE);
-       SSL_OptionSetDefault (SSL_V2_COMPATIBLE_HELLO, PR_TRUE /* maybe? */);
 #endif /* HAVE_NSS */
        
        path = g_strdup_printf ("%s/camel-cert.db", configdir);
@@ -117,5 +115,7 @@ camel_init (const char *configdir, gboolean nss_init)
        
        camel_object_unref (certdb);
        
+       g_atexit (camel_shutdown);
+       
        return 0;
 }