Index: libsoup/soup-session-async.c
===================================================================
--- libsoup/soup-session-async.c	(revision 952)
+++ libsoup/soup-session-async.c	(working copy)
@@ -11,6 +11,7 @@
 
 #include "soup-session-async.h"
 #include "soup-connection.h"
+#include "soup-misc.h"
 
 static gboolean run_queue (SoupSessionAsync *sa, gboolean try_pruning);
 
@@ -204,6 +205,7 @@
 	       SoupMessageCallbackFn callback, gpointer user_data)
 {
 	SoupSessionAsync *sa = SOUP_SESSION_ASYNC (session);
+	GMainContext *async_context;
 
 	g_signal_connect (req, "restarted",
 			  G_CALLBACK (request_restarted), sa);
@@ -218,7 +220,12 @@
 	SOUP_SESSION_CLASS (soup_session_async_parent_class)->queue_message (session, req, callback, user_data);
 
 	g_object_ref (sa);
-	g_idle_add (idle_run_queue, sa);
+	g_object_get (G_OBJECT (session),
+		      SOUP_SESSION_ASYNC_CONTEXT, &async_context,
+		      NULL);
+	soup_add_idle (async_context, idle_run_queue, sa);
+	if (async_context)
+		g_main_context_unref (async_context);
 }
 
 static guint
@@ -239,5 +246,7 @@
 	       !SOUP_STATUS_IS_TRANSPORT_ERROR (req->status_code))
 		g_main_context_iteration (async_context, TRUE);
 
+	if (async_context)
+		g_main_context_unref (async_context);
 	return req->status_code;
 }
Index: libsoup/soup-session-sync.c
===================================================================
--- libsoup/soup-session-sync.c	(revision 951)
+++ libsoup/soup-session-sync.c	(working copy)
@@ -137,6 +137,8 @@
 			      SOUP_SESSION_ASYNC_CONTEXT, &async_context,
 			      NULL);
 		soup_add_idle (async_context, queue_message_callback, sad);
+		if (async_context)
+			g_main_context_unref (async_context);
 	} else
 		async_data_free (sad);
 
Index: libsoup/soup-message-io.c
===================================================================
--- libsoup/soup-message-io.c	(revision 952)
+++ libsoup/soup-message-io.c	(working copy)
@@ -926,6 +926,8 @@
 		soup_add_idle (async_context, io_unpause_internal, msg);
 	else
 		io_unpause_internal (msg);
+	if (async_context)
+		g_main_context_unref (async_context);
 }
 
 /**
