[evolution-patches] nntp cache crash patch



unreported bug, starting offline mode, it crashes if it tries to load a
message at startup.


Index: camel/providers/nntp/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/ChangeLog,v
retrieving revision 1.5
diff -u -p -r1.5 ChangeLog
--- camel/providers/nntp/ChangeLog	11 May 2005 04:43:33 -0000	1.5
+++ camel/providers/nntp/ChangeLog	3 Aug 2005 10:52:25 -0000
@@ -1,3 +1,9 @@
+2005-08-02  Not Zed  <NotZed Ximian com>
+
+	* camel-nntp-store.c (nntp_construct): setup the cache here.
+	(nntp_connect_offline, nntp_connect_online): not here or here.
+	(nntp_store_finalize): free the cache.
+
 2005-04-30  Alessandro Decina  <alessandro nnnva org>
 
 	* camel-nntp-store.c (nntp_folder_info_from_store_info): Copy the
Index: camel/providers/nntp/camel-nntp-store.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/providers/nntp/camel-nntp-store.c,v
retrieving revision 1.80
diff -u -p -r1.80 camel-nntp-store.c
--- camel/providers/nntp/camel-nntp-store.c	11 May 2005 04:43:33 -0000	1.80
+++ camel/providers/nntp/camel-nntp-store.c	3 Aug 2005 10:52:26 -0000
@@ -174,20 +174,6 @@ connect_to_server (CamelService *service
 	
 	CAMEL_SERVICE_LOCK(store, connect_lock);
 
-	/* setup store-wide cache */
-	if (store->cache == NULL) {
-		if (store->storage_path == NULL)
-			goto fail;
-		
-		store->cache = camel_data_cache_new (store->storage_path, 0, ex);
-		if (store->cache == NULL)
-			goto fail;
-		
-		/* Default cache expiry - 2 weeks old, or not visited in 5 days */
-		camel_data_cache_set_expire_age (store->cache, 60*60*24*14);
-		camel_data_cache_set_expire_access (store->cache, 60*60*24*5);
-	}
-	
 	if (ssl_mode != MODE_CLEAR) {
 #ifdef HAVE_SSL
 		if (ssl_mode == MODE_TLS) {
@@ -1012,6 +998,9 @@ nntp_store_finalize (CamelObject *object
 		g_free(xover);
 		xover = xn;
 	}
+
+	if (nntp_store->cache)
+		camel_object_unref(nntp_store->cache);
 	
 	g_free(p);
 }
@@ -1100,8 +1089,16 @@ nntp_construct (CamelService *service, C
 		nntp_store->folder_hierarchy_relative = TRUE;
 	else
 		nntp_store->folder_hierarchy_relative = FALSE;
-}
 
+	/* setup store-wide cache */
+	nntp_store->cache = camel_data_cache_new(nntp_store->storage_path, 0, ex);
+	if (nntp_store->cache == NULL)
+		return;
+		
+	/* Default cache expiry - 2 weeks old, or not visited in 5 days */
+	camel_data_cache_set_expire_age(nntp_store->cache, 60*60*24*14);
+	camel_data_cache_set_expire_access(nntp_store->cache, 60*60*24*5);
+}
 
 static void
 nntp_store_init (gpointer object, gpointer klass)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]