From 4052f5078c02b223b32b18dba6524e5b6201f3cf Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 2 Nov 2008 18:21:05 +0000 Subject: ** Fixes bug #557613 2008-11-02 Matthew Barnes ** Fixes bug #557613 * mail/em-utils.c (try_open_e_book): Wait for try_open_e_book_cb() to run before freeing the EFlag. It will run regardless of whether the EBook operation completes. svn path=/trunk/; revision=36715 --- mail/ChangeLog | 8 ++++++++ mail/em-utils.c | 10 +++++----- 2 files changed, 13 insertions(+), 5 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 3305c700dd..4285524742 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,11 @@ +2008-11-02 Matthew Barnes + + ** Fixes bug #557613 + + * em-utils.c (try_open_e_book): + Wait for try_open_e_book_cb() to run before freeing the EFlag. + It will run regardless of whether the EBook operation completes. + 2008-10-31 Matthew Barnes ** Fixes part of bug #558726 (patch by Frederic van Starbmann) diff --git a/mail/em-utils.c b/mail/em-utils.c index 9b091c68cf..bb92d7ad03 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2081,14 +2081,14 @@ try_open_e_book (EBook *book, gboolean only_if_exists, GError **error) e_flag_timed_wait (flag, &wait); } - e_flag_free (flag); - if (canceled) { g_set_error (error, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED, "Operation has been canceled."); e_book_cancel_async_op (book, NULL); - return FALSE; } + e_flag_wait (flag); + e_flag_free (flag); + return data.result; } @@ -2183,7 +2183,7 @@ em_utils_in_addressbook (CamelInternetAddress *iaddr, gboolean local_only) stop = err && err->domain == E_BOOK_ERROR && err->code == E_BOOK_ERROR_CANCELLED; mail_cancel_hook_remove(hook); g_object_unref(book); - d(g_warning("Can't get contacts: %s", err->message)); + g_warning("Can't get contacts: %s", err->message); g_clear_error(&err); continue; } @@ -2267,7 +2267,7 @@ em_utils_contact_photo (struct _CamelInternetAddress *cia, gboolean local) || !e_book_get_contacts(book, query, &contacts, &err)) { stop = err && err->domain == E_BOOK_ERROR && err->code == E_BOOK_ERROR_CANCELLED; g_object_unref(book); - d(g_warning("Can't get contacts: %s", err->message)); + g_warning("Can't get contacts: %s", err->message); g_clear_error(&err); continue; } -- cgit