evolution-data-server r8708 - in branches/gnome-2-22/addressbook: . backends/groupwise libedata-book



Author: abharath
Date: Wed Apr 30 05:36:38 2008
New Revision: 8708
URL: http://svn.gnome.org/viewvc/evolution-data-server?rev=8708&view=rev

Log:
Committing on behalf of Chenthill Palanisamy  <pchenthill novell com>

2008-04-30  Chenthill Palanisamy  <pchenthill novell com>

        ** Fixes part of #350143 (bnc)
           Severe memory leak in evolution-data-server


Modified:
   branches/gnome-2-22/addressbook/ChangeLog
   branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c
   branches/gnome-2-22/addressbook/libedata-book/e-book-backend-summary.c

Modified: branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c
==============================================================================
--- branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c	(original)
+++ branches/gnome-2-22/addressbook/backends/groupwise/e-book-backend-groupwise.c	Wed Apr 30 05:36:38 2008
@@ -2702,6 +2702,9 @@
 			printf("e_gw_connection_read_cursor took %ld.%03ld seconds for %d contacts\n", diff / 1000, diff % 1000, CURSOR_ITEM_LIMIT);
 		}
 
+		if (status != E_GW_CONNECTION_STATUS_OK)
+		       	 break;	
+
 		for (l = gw_items; l != NULL; l = g_list_next (l)) {
 			contact_num++;
 
@@ -2841,12 +2844,6 @@
 	tm = gmtime (&mod_time);
 	strftime (cache_time_string, 100, "%Y-%m-%dT%H:%M:%SZ", tm);
 
-	if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE ||
-	    e_book_backend_summary_is_up_to_date (ebgw->priv->summary, mod_time) == FALSE) {
-		/* build summary */
-		 build_summary (ebgw);
-	}
-
 	filter = e_gw_filter_new ();
 	e_gw_filter_add_filter_component (filter, E_GW_FILTER_OP_GREATERTHAN,
 					  "modified", cache_time_string);
@@ -3010,11 +3007,6 @@
 	g_stat (cache_file_name, &buf);
 	g_free (cache_file_name);
 	mod_time = buf.st_mtime;
-	if (e_book_backend_summary_load (ebgw->priv->summary) == FALSE ||
-	    e_book_backend_summary_is_up_to_date (ebgw->priv->summary, mod_time) == FALSE) {
-		/* build summary */
-		 build_summary (ebgw);
-	}
 
 	if (cache_last_sequence != server_last_sequence) {
 
@@ -3341,6 +3333,13 @@
 		if (e_book_backend_db_cache_is_populated (ebgw->priv->file_db)) {
 			if (enable_debug)
 				printf("cache is populated\n");
+
+			if (!e_book_backend_summary_load (priv->summary))
+				build_summary (ebgw);
+			
+			ebgw->priv->is_cache_ready = TRUE;
+			ebgw->priv->is_summary_ready = TRUE;
+
 			if (priv->is_writable){
 				if (enable_debug) {
 					printf("is writable\n");

Modified: branches/gnome-2-22/addressbook/libedata-book/e-book-backend-summary.c
==============================================================================
--- branches/gnome-2-22/addressbook/libedata-book/e-book-backend-summary.c	(original)
+++ branches/gnome-2-22/addressbook/libedata-book/e-book-backend-summary.c	Wed Apr 30 05:36:38 2008
@@ -771,6 +771,10 @@
 		return;
 	}
 
+	/* Ensure the duplicate contacts are not added */
+	if (e_book_backend_summary_check_contact (summary, id))
+		e_book_backend_summary_remove_contact (summary, id);
+
 	new_item = g_new0 (EBookBackendSummaryItem, 1);
 
 	new_item->id         = id;



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