[evolution-ews] Don't ref/unref connection repeatedly in calendar code.



commit 393056cf6ffe8a84f17b26b9db1b3f6aee2e77c0
Author: David Woodhouse <David Woodhouse intel com>
Date:   Tue Aug 16 16:44:41 2011 +0100

    Don't ref/unref connection repeatedly in calendar code.
    
    We hold a ref on it via cbews->priv, so this shouldn't be needed.
    
    I suspect this was causing the stray unref of cnc which caused problems
    when we fixed the GSimpleAsyncResult leak. Before we fixed the leak, those
    leaked objects would each have a reference on the connection and would
    mask the problem.

 src/calendar/e-cal-backend-ews.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index d88025d..7c4c33f 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -3073,7 +3073,6 @@ exit:
 	g_free (sync_data->master_uid);
 	g_free (sync_data->sync_state);
 	g_free (sync_data);
-	g_object_unref (cnc);
 }
 
 static void
@@ -3130,7 +3129,6 @@ ews_cal_sync_items_ready_cb (GObject *obj, GAsyncResult *res, gpointer user_data
 		PRIV_UNLOCK (priv);
 
 		g_clear_error (&error);
-		g_object_unref (cnc);
 		return;
 	}
 
@@ -3189,7 +3187,7 @@ ews_cal_sync_items_ready_cb (GObject *obj, GAsyncResult *res, gpointer user_data
 	}
 
 	if (cal_item_ids)
-		e_ews_connection_get_items_start (g_object_ref (cnc),
+		e_ews_connection_get_items_start (cnc,
 						  EWS_PRIORITY_MEDIUM,
 						  cal_item_ids,
 						  "IdOnly",
@@ -3200,7 +3198,7 @@ ews_cal_sync_items_ready_cb (GObject *obj, GAsyncResult *res, gpointer user_data
 						  (gpointer) sync_data);
 
 	if (task_item_ids)
-		e_ews_connection_get_items_start (g_object_ref (cnc), EWS_PRIORITY_MEDIUM,
+		e_ews_connection_get_items_start (cnc, EWS_PRIORITY_MEDIUM,
 						  task_item_ids,
 						  "AllProperties",
 						  NULL,
@@ -3212,7 +3210,6 @@ ews_cal_sync_items_ready_cb (GObject *obj, GAsyncResult *res, gpointer user_data
 
 
 exit:
-	g_object_unref (cnc);
 	if (cal_item_ids) {
 		g_slist_foreach (cal_item_ids, (GFunc) g_free, NULL);
 		g_slist_free (cal_item_ids);
@@ -3246,7 +3243,7 @@ ews_start_sync	(gpointer data)
 
 	sync_state = e_cal_backend_store_get_key_value (priv->store, SYNC_KEY);
 	e_ews_connection_sync_folder_items_start
-						(g_object_ref (priv->cnc), EWS_PRIORITY_MEDIUM,
+						(priv->cnc, EWS_PRIORITY_MEDIUM,
 						 sync_state, priv->folder_id,
 						 "IdOnly", NULL,
 						 EWS_MAX_FETCH_COUNT,



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