summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWill Thompson <will.thompson@collabora.co.uk>2012-10-30 17:32:56 +0000
committerWill Thompson <will.thompson@collabora.co.uk>2012-10-30 17:38:10 +0000
commitba22cc02a652a2ccfe6b59b113a87b2fe3761543 (patch)
tree17bc4395c7a8b4783fcac33770396b6e1a7a3349 /src
parent39ed6a0d707397fa13ba6d19580d257b7b2df8e2 (diff)
connection: cope with send_async() returning synchronously
On <https://bugs.freedesktop.org/show_bug.cgi?id=49163>, Alban Browaeys described a situation where idle_server_connection_send_async() would call its callback synchronously, due to a bug in GLib. While I think that bug is fixed, we can be more defensive against this by initializing priv->msg_sending to TRUE before calling idle_server_connection_send_async() rather than after. That way, if the _msg_queue_timeout_ready() callback is called synchronously (due to a bug), Idle won't get stuck thinking it's sending a message.
Diffstat (limited to 'src')
-rw-r--r--src/idle-connection.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/idle-connection.c b/src/idle-connection.c
index a65bc70..d48564d 100644
--- a/src/idle-connection.c
+++ b/src/idle-connection.c
@@ -862,9 +862,9 @@ static gboolean msg_queue_timeout_cb(gpointer user_data) {
return FALSE;
}
+ priv->msg_sending = TRUE;
idle_server_connection_send_async(priv->conn, output_msg->message, NULL, _msg_queue_timeout_ready, conn);
idle_output_pending_msg_free (output_msg);
- priv->msg_sending = TRUE;
return TRUE;
}