summaryrefslogtreecommitdiff
path: root/gdbus/mainloop.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2010-10-13 15:06:46 +0300
committerMarcel Holtmann <marcel@holtmann.org>2010-10-13 15:53:44 +0300
commitfd6b74727b0baf2d89f448721296149bf2852869 (patch)
tree4b6847a263968a128adc418ab1ebcc60acbd9748 /gdbus/mainloop.c
parent6056f1caec4085a8a949e5b1918185ad13394fea (diff)
downloadbluez-fd6b74727b0baf2d89f448721296149bf2852869.tar.gz
gdbus: fix not handling bus disconnects
We where not dispatching data when a bus disconnects which cause Disconnected signal to not be processed and thus causing the process to either not exit or to not trigger callbacks registered with g_dbus_set_disconnect_function. To fix this now we always schedule a dispatch which will make sure data still not processed will make its way to the proper handlers even if disconnected.
Diffstat (limited to 'gdbus/mainloop.c')
-rw-r--r--gdbus/mainloop.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c
index ec10ab069..862c434a9 100644
--- a/gdbus/mainloop.c
+++ b/gdbus/mainloop.c
@@ -95,6 +95,7 @@ static gboolean watch_func(GIOChannel *chan, GIOCondition cond, gpointer data)
{
struct watch_info *info = data;
unsigned int flags = 0;
+ DBusDispatchStatus status;
dbus_connection_ref(info->conn);
@@ -105,6 +106,9 @@ static gboolean watch_func(GIOChannel *chan, GIOCondition cond, gpointer data)
dbus_watch_handle(info->watch, flags);
+ status = dbus_connection_get_dispatch_status(info->conn);
+ queue_dispatch(info->conn, status);
+
dbus_connection_unref(info->conn);
return TRUE;