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



commit 77d9e34d376aed2a3ca4f8a70fce3cda2842edb5
Author: Milan Crha <mcrha redhat com>
Date:   Thu May 10 12:55:20 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 df1f682..cd20dec 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -917,12 +917,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]