summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-hci.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-hci.c')
-rw-r--r--hcid/dbus-hci.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 679170ff..1b7c9cfa 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -63,6 +63,9 @@ static DBusConnection *connection = NULL;
void bonding_request_free(struct bonding_request_info *bonding)
{
+ struct device *device;
+ char address[18];
+
if (!bonding)
return;
@@ -75,6 +78,14 @@ void bonding_request_free(struct bonding_request_info *bonding)
if (bonding->io)
g_io_channel_unref(bonding->io);
+ ba2str(&bonding->bdaddr, address);
+
+ device = adapter_get_device(connection, bonding->adapter, address);
+ if (device && device->agent) {
+ agent_destroy(device->agent, FALSE);
+ device->agent = NULL;
+ }
+
g_free(bonding);
}