[evolution-ews] Don't fetch (and leak) ews_get_folder_sync().



commit 9e0fab517d6b77fe2b7810af88597c4f64a39988
Author: David Woodhouse <David Woodhouse intel com>
Date:   Sat Aug 13 22:57:11 2011 +0100

    Don't fetch (and leak) ews_get_folder_sync().
    
    We're only interested in whether we *have* any cached info yet. Which the
    sync_state will tell us. Stop leaking that too, while we're at it.

 src/camel/camel-ews-store.c |   10 +++-------
 1 files changed, 3 insertions(+), 7 deletions(-)
---
diff --git a/src/camel/camel-ews-store.c b/src/camel/camel-ews-store.c
index bdb8b85..40be300 100644
--- a/src/camel/camel-ews-store.c
+++ b/src/camel/camel-ews-store.c
@@ -480,7 +480,6 @@ ews_get_folder_info_sync (CamelStore *store, const gchar *top, guint32 flags, EV
 	CamelEwsStorePrivate *priv;
 	CamelFolderInfo *fi = NULL;
 	gchar *sync_state;
-	GSList *folders = NULL;
 	gboolean initial_setup = FALSE;
 	GSList *folders_created = NULL, *folders_updated = NULL;
 	GSList *folders_deleted = NULL;
@@ -497,14 +496,14 @@ ews_get_folder_info_sync (CamelStore *store, const gchar *top, guint32 flags, EV
 	}
 
 	sync_state = camel_ews_store_summary_get_string_val (ews_store->summary, "sync_state", NULL);
-
-	folders = camel_ews_store_summary_get_folders (ews_store->summary, NULL);
-	if (!folders)
+	if (!sync_state)
 		initial_setup = TRUE;
 
 	if (!initial_setup && flags & CAMEL_STORE_FOLDER_INFO_SUBSCRIBED) {
 		time_t now = time (NULL);
 
+		g_free (sync_state);
+
 		if (now - priv->last_refresh_time > FINFO_REFRESH_INTERVAL) {
 			struct _ews_refresh_msg *m;
 
@@ -518,9 +517,6 @@ ews_get_folder_info_sync (CamelStore *store, const gchar *top, guint32 flags, EV
 		goto offline;
 	}
 
-	g_slist_foreach (folders, (GFunc)g_free, NULL);
-	g_slist_free (folders);
-
 	if (!e_ews_connection_sync_folder_hierarchy (ews_store->priv->cnc, EWS_PRIORITY_MEDIUM,
 						    &sync_state, &includes_last_folder,
 						    &folders_created, &folders_updated,



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