From 362cef3d989abcb2a4e7bfd5a33312d7a7903b0e Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Tue, 9 Aug 2011 13:47:44 -0300 Subject: [PATCH] Fix ATT disconnect callback not being called GAttrib disconnect function needs to be set after discovering the primary services if the connection callback list is not empty. After creating a device the connection can stay up, for this scenario the registered disconnection callbacks are not being called. --- src/device.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index f2f021a74..25d85df52 100644 --- a/src/device.c +++ b/src/device.c @@ -1665,7 +1665,9 @@ static void primary_cb(GSList *services, guint8 status, gpointer user_data) if (device->attios == NULL && device->attios_offline == NULL) { g_attrib_unref(device->attrib); device->attrib = NULL; - } + } else + g_attrib_set_disconnect_function(device->attrib, + attrib_disconnected, device); g_slist_free(uuids); -- 2.47.3