From eac83af8160560ca4d277081b7cffefdfdc77bf2 Mon Sep 17 00:00:00 2001 From: Andre Guedes Date: Wed, 8 Feb 2012 16:05:10 -0300 Subject: [PATCH] device: Shutdown connection if ATTIO list is empty Shutdown the ongoing connection attempt if the last ATTIO callback is removed from the list. --- src/device.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/device.c b/src/device.c index 763c79c18..bd25a27e8 100644 --- a/src/device.c +++ b/src/device.c @@ -2958,5 +2958,11 @@ gboolean btd_device_remove_attio_callback(struct btd_device *device, guint id) device->attrib = NULL; } + if (device->att_io) { + g_io_channel_shutdown(device->att_io, FALSE, NULL); + g_io_channel_unref(device->att_io); + device->att_io = NULL; + } + return TRUE; } -- 2.47.3