Milan Crha <mcrha@redhat.com> ** Part of fix for bug #328216 (Do not free default...
authorSuman Manjunath <msuman@src.gnome.org>
Mon, 8 Sep 2008 03:24:31 +0000 (03:24 +0000)
committerSuman Manjunath <msuman@src.gnome.org>
Mon, 8 Sep 2008 03:24:31 +0000 (03:24 +0000)
svn path=/trunk/; revision=9491

camel/ChangeLog
camel/camel-certdb.c
camel/camel.c

index d48faff..730663c 100644 (file)
@@ -1,3 +1,11 @@
+2008-09-08  Milan Crha  <mcrha@redhat.com>
+
+       ** Part of fix for bug #328216
+
+       * camel.c: (camel_shutdown): Do not free default certdb itself,
+       rather set it to NULL to not have freed pointer flying around.
+       * camel-certdb.c: (camel_certdb_save): Save only when changed.
+
 2008-09-05  Paul Bolle  <pebolle@tiscali.nl>
 
        ** Fix for bug #550412
index ccdb4d1..d6540be 100644 (file)
@@ -336,7 +336,11 @@ camel_certdb_save (CamelCertDB *certdb)
        
        g_return_val_if_fail (CAMEL_IS_CERTDB (certdb), -1);
        g_return_val_if_fail (certdb->filename, -1);
-       
+
+       /* no change, nothing new to save, simply return success */
+       if ((certdb->flags & CAMEL_CERTDB_DIRTY) == 0)
+               return 0;
+
        filename = alloca (strlen (certdb->filename) + 4);
        sprintf (filename, "%s~", certdb->filename);
        
index ea1077c..d19ffcc 100644 (file)
@@ -132,7 +132,7 @@ camel_shutdown (void)
        certdb = camel_certdb_get_default ();
        if (certdb) {
                camel_certdb_save (certdb);
-               camel_object_unref (certdb);
+               camel_certdb_set_default (NULL);
        }
 
        /* These next calls must come last. */