summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakub Pawlowski <jpawlowski@google.com>2015-10-01 22:18:58 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-10-08 17:49:40 +0300
commit0ab3242f26d6c3dda80cf0b162d65f138613a2ed (patch)
tree35de45312e47c56b6bcac38cfc48734db5b9ced5 /src
parent57133737a1238d26e6fce482e73800f1da4139a2 (diff)
downloadbluez-0ab3242f26d6c3dda80cf0b162d65f138613a2ed.tar.gz
core/device: Fix disconnect for connect attempt
Right now calling Disconnect from DBus on device that's not advertising or out of sight will not stop the connect attempt in kernel. This patch fixes that by making sure that att_io is properly cleaned up on disconnect.
Diffstat (limited to 'src')
-rw-r--r--src/device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/device.c b/src/device.c
index 5ec8780d8..fd177f48f 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1355,6 +1355,12 @@ void device_request_disconnect(struct btd_device *device, DBusMessage *msg)
if (device->browse)
browse_request_cancel(device->browse);
+ if (device->att_io) {
+ g_io_channel_shutdown(device->att_io, FALSE, NULL);
+ g_io_channel_unref(device->att_io);
+ device->att_io = NULL;
+ }
+
if (device->connect) {
DBusMessage *reply = btd_error_failed(device->connect,
"Cancelled");