diff options
author | Milan Crha <mcrha@redhat.com> | 2013-07-17 15:49:34 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2013-07-17 15:52:02 +0800 |
commit | fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f (patch) | |
tree | 4993ae3e1786ddc1a90146bfecb0522f4f8614b8 /e-util | |
parent | a8912305321a2ca2b902598566ef0a8ced490cd6 (diff) | |
download | gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar.gz gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar.bz2 gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar.lz gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar.xz gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.tar.zst gsoc2013-evolution-fdf5ef898315a7ca3e2543b42e9c2f81fdc6b86f.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.
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-contact-store.c | 19 |
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, |