From 0ef15e5fac1f00a159a157bcd82d22b2d2eaea53 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 15 Sep 2011 21:13:46 +0200 Subject: [PATCH] input/soup: unlock before cancelling the soup message Avoid recursive deadlock in _session_callback(). --- src/input/soup_input_plugin.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/input/soup_input_plugin.c b/src/input/soup_input_plugin.c index 38a607045..7a2f3b47a 100644 --- a/src/input/soup_input_plugin.c +++ b/src/input/soup_input_plugin.c @@ -246,12 +246,14 @@ input_soup_close(struct input_stream *is) if (s->alive) { assert(s->msg != NULL); + s->alive = false; + g_mutex_unlock(s->mutex); + soup_session_cancel_message(soup_session, s->msg, SOUP_STATUS_CANCELLED); - s->alive = false; - } + } else + g_mutex_unlock(s->mutex); - g_mutex_unlock(s->mutex); g_mutex_free(s->mutex); g_cond_free(s->cond);