aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-09-19 05:04:53 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-09-19 05:04:53 +0800
commitb064ae4fa7984eda4946ba1b874d5a36a50eb0ea (patch)
tree0ec3159924725b5cd563088ed1c42d7c5b219341
parenta98c07a569292fa66f91d3fa4bd32f32adff1880 (diff)
downloadgsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar.gz
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar.bz2
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar.lz
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar.xz
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.tar.zst
gsoc2013-evolution-b064ae4fa7984eda4946ba1b874d5a36a50eb0ea.zip
Avoid a deadlock in mail_msg_free().
-rw-r--r--mail/mail-mt.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/mail/mail-mt.c b/mail/mail-mt.c
index 76e2629121..fbbe925b74 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);