From 2a2b11b1bb6c702d6b2ef1c37524a57688a94a4e Mon Sep 17 00:00:00 2001 From: Lukasz Skalski Date: Thu, 23 Apr 2015 13:32:23 +0000 Subject: [PATCH] [kdbus] Fix problem with receiving async messages --- gio/gdbusconnection.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gio/gdbusconnection.c b/gio/gdbusconnection.c index ca09ae3..4b3f839 100644 --- a/gio/gdbusconnection.c +++ b/gio/gdbusconnection.c @@ -2712,7 +2712,12 @@ g_dbus_connection_send_message_with_reply_sync (GDBusConnection *connecti g_return_val_if_fail (error == NULL || *error == NULL, NULL); data = g_new0 (SendMessageSyncData, 1); - data->context = g_main_context_new (); + + if (connection->kdbus_worker) + data->context = g_main_context_ref_thread_default (); + else + data->context = g_main_context_new (); + data->loop = g_main_loop_new (data->context, FALSE); g_main_context_push_thread_default (data->context); -- 2.7.4