[evolution-data-server] Make sure data-book/cal is closed/freed in a separate thread



commit 58f05268aa998f7720eb7a84c2d1abbdcb3f1c3d
Author: Milan Crha <mcrha redhat com>
Date:   Thu May 10 12:54:16 2012 +0200

    Make sure data-book/cal is closed/freed in a separate thread
    
    When EDataBook/EDataCal was unreffed in the main thread then
    any later calls to the factory were blocked by the backend
    till it freed its resources, possibly making client look like
    frozen/unresponsive.

 addressbook/libedata-book/e-data-book.c |    4 ++--
 calendar/libedata-cal/e-data-cal.c      |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 03d7506..095c9bd 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -810,12 +810,12 @@ impl_Book_close (EGdbusBook *object,
 	OperationData *op;
 
 	op = op_new (OP_CLOSE, book);
+	/* unref here makes sure the book is freed in a separate thread */
+	g_object_unref (book);
 
 	e_gdbus_book_complete_close (book->priv->gdbus_object, invocation, NULL);
 	e_operation_pool_push (ops_pool, op);
 
-	g_object_unref (book);
-
 	return TRUE;
 }
 
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index e3123cd..40e294d 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -915,12 +915,12 @@ impl_Cal_close (EGdbusCal *object,
 	OperationData *op;
 
 	op = op_new (OP_CLOSE, cal);
+	/* unref here makes sure the cal is freed in a separate thread */
+	g_object_unref (cal);
 
 	e_gdbus_cal_complete_close (cal->priv->gdbus_object, invocation, NULL);
 	e_operation_pool_push (ops_pool, op);
 
-	g_object_unref (cal);
-
 	return TRUE;
 }
 



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