aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-07-17 15:49:34 +0800
committerMilan Crha <mcrha@redhat.com>2013-07-17 15:49:34 +0800
commit5818e4c241dec1a0846e83820c50c9c50a003d76 (patch)
treeb45fde03b8366c8c5a8e1042dde8a6484820f31f
parentd3fdc59c401763d465f996552c02b284dc44be0b (diff)
downloadgsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar.gz
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar.bz2
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar.lz
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar.xz
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.tar.zst
gsoc2013-evolution-5818e4c241dec1a0846e83820c50c9c50a003d76.zip
EContactStore: Stop book views in a dedicated thread
I've got UI freeze in a call of e_book_client_view_stop() on contact store dispose, caused by synchronous D-Bus call. Doing the call in a dedicated thread makes no UI freeze here.
-rw-r--r--e-util/e-contact-store.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/e-util/e-contact-store.c b/e-util/e-contact-store.c
index 6d2adc067f..8e34c20546 100644
--- a/e-util/e-contact-store.c
+++ b/e-util/e-contact-store.c
@@ -717,6 +717,20 @@ view_complete (EContactStore *contact_store,
* View/Query management *
* --------------------- */
+static gpointer
+contact_store_stop_view_in_thread (gpointer user_data)
+{
+ EBookClientView *view = user_data;
+
+ g_return_val_if_fail (E_IS_BOOK_CLIENT_VIEW (view), NULL);
+
+ /* this does blocking D-Bus call, thus do it in a dedicated thread */
+ e_book_client_view_stop (view, NULL);
+ g_object_unref (view);
+
+ return NULL;
+}
+
static void
start_view (EContactStore *contact_store,
EBookClientView *view)
@@ -743,7 +757,10 @@ static void
stop_view (EContactStore *contact_store,
EBookClientView *view)
{
- e_book_client_view_stop (view, NULL);
+ GThread *thread;
+
+ thread = g_thread_new (NULL, contact_store_stop_view_in_thread, g_object_ref (view));
+ g_thread_unref (thread);
g_signal_handlers_disconnect_matched (
view, G_SIGNAL_MATCH_DATA,