[evolution] Avoid a deadlock in mail_msg_free().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution] Avoid a deadlock in mail_msg_free().
- Date: Sat, 18 Sep 2010 21:05:08 +0000 (UTC)
commit b064ae4fa7984eda4946ba1b874d5a36a50eb0ea
Author: Matthew Barnes <mbarnes redhat com>
Date: Sat Sep 18 17:04:53 2010 -0400
Avoid a deadlock in mail_msg_free().
mail/mail-mt.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 76e2629..fbbe925 100644
--- a/mail/mail-mt.c
+++ b/mail/mail-mt.c
@@ -152,15 +152,6 @@ mail_msg_free (MailMsg *mail_msg)
shell_backend = e_shell_get_backend_by_name (
shell, shell_builtin_backend);
- g_mutex_lock (mail_msg_lock);
-
- g_hash_table_remove (
- mail_msg_active_table,
- GINT_TO_POINTER (mail_msg->seq));
- g_cond_broadcast (mail_msg_cond);
-
- g_mutex_unlock (mail_msg_lock);
-
if (mail_msg->priv->activity != NULL) {
e_activity_complete (mail_msg->priv->activity);
g_object_unref (mail_msg->priv->activity);
@@ -221,6 +212,15 @@ mail_msg_unref (gpointer msg)
if (mail_msg->info->free)
mail_msg->info->free (mail_msg);
+ g_mutex_lock (mail_msg_lock);
+
+ g_hash_table_remove (
+ mail_msg_active_table,
+ GINT_TO_POINTER (mail_msg->seq));
+ g_cond_broadcast (mail_msg_cond);
+
+ g_mutex_unlock (mail_msg_lock);
+
/* Destroy the message from an idle callback
* so we know we're in the main loop thread. */
g_idle_add ((GSourceFunc) mail_msg_free, mail_msg);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]