[evolution-ews/gnome-3-4] Bug #668555 Crash in ews_cal_sync_items_ready_cb (cherry picked from commit 54d5b1fdb79ae32db59d40a0



commit e8c06b06d4a8fa7824e4060183ffb0ee606ff4c9
Author: Punit Jain <jpunit suse com>
Date:   Mon Mar 26 17:22:53 2012 +0530

    Bug #668555 Crash in ews_cal_sync_items_ready_cb
    (cherry picked from commit 54d5b1fdb79ae32db59d40a0241b47ba172ad7e6)

 src/calendar/e-cal-backend-ews.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/calendar/e-cal-backend-ews.c b/src/calendar/e-cal-backend-ews.c
index 9d165d2..9c40f41 100644
--- a/src/calendar/e-cal-backend-ews.c
+++ b/src/calendar/e-cal-backend-ews.c
@@ -3282,7 +3282,7 @@ ews_cal_get_items_ready_cb (GObject *obj,
 			const EwsId *item_id = e_ews_item_get_id (l->data);
 
 			sub_sync_data = g_new0 (struct _ews_sync_data, 1);
-			sub_sync_data->cbews = sync_data->cbews;
+			sub_sync_data->cbews = g_object_ref (sync_data->cbews);
 			sub_sync_data->master_uid = g_strdup (item_id->id);
 
 			e_ews_connection_get_items_start (g_object_ref (cnc), EWS_PRIORITY_MEDIUM,
@@ -3316,9 +3316,10 @@ ews_cal_get_items_ready_cb (GObject *obj,
 						 "IdOnly", NULL,
 						 EWS_MAX_FETCH_COUNT,
 						 ews_cal_sync_items_ready_cb,
-						 NULL, cbews);
+						 NULL, g_object_ref (cbews));
 
 exit:
+	g_object_unref (sync_data->cbews);
 	g_free (sync_data->master_uid);
 	g_free (sync_data->sync_state);
 	g_free (sync_data);
@@ -3360,6 +3361,7 @@ ews_cal_sync_items_ready_cb (GObject *obj,
 		PRIV_UNLOCK (priv);
 
 		g_clear_error (&error);
+		g_object_unref (cbews);
 		return;
 	}
 
@@ -3405,14 +3407,14 @@ ews_cal_sync_items_ready_cb (GObject *obj,
 						 "IdOnly", NULL,
 						 EWS_MAX_FETCH_COUNT,
 						 ews_cal_sync_items_ready_cb,
-						 NULL, cbews);
+						 NULL, g_object_ref (cbews));
 		g_free (sync_state);
 		goto exit;
 	}
 
 	if (cal_item_ids || task_item_ids) {
 		sync_data = g_new0 (struct _ews_sync_data, 1);
-		sync_data->cbews = cbews;
+		sync_data->cbews = g_object_ref (cbews);
 		sync_data->sync_state = sync_state;
 		sync_data->sync_pending = !includes_last_item;
 	}
@@ -3455,6 +3457,8 @@ exit:
 		g_slist_free (items_updated);
 	if (items_deleted)
 		g_slist_free (items_deleted);
+
+	g_object_unref (cbews);
 }
 
 static gboolean
@@ -3478,7 +3482,7 @@ ews_start_sync (gpointer data)
 						 "IdOnly", NULL,
 						 EWS_MAX_FETCH_COUNT,
 						 ews_cal_sync_items_ready_cb,
-						 NULL, cbews);
+						 NULL, g_object_ref (cbews));
 	return TRUE;
 }
 



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