summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2008-03-14 19:35:04 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2008-03-14 19:35:04 +0000
commitd3b161cefcb2759c2c8a2fee00ee9f51ca84371b (patch)
tree43ed14fe5213392d1aad4fcf27d25b7c66b9ecdd /hcid
parente9a2d42cf67f70430a563bd23d24774cdb15b97b (diff)
Call agent_release at appropriate places
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-hci.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 981d6821..0e4ffbba 100644
--- a/hcid/dbus-hci.c
+++ b/hcid/dbus-hci.c
@@ -59,6 +59,7 @@
#include "dbus-test.h"
#include "dbus-service.h"
#include "dbus-security.h"
+#include "agent.h"
#include "dbus-hci.h"
static DBusConnection *connection = NULL;
@@ -399,6 +400,12 @@ int unregister_adapter_path(const char *path)
release_passkey_agents(adapter, NULL);
+ if (adapter->agent) {
+ agent_release(adapter->agent);
+ agent_destroy(adapter->agent, FALSE);
+ adapter->agent = NULL;
+ }
+
if (adapter->discov_requestor) {
name_listener_remove(connection,
adapter->discov_requestor,
@@ -796,6 +803,12 @@ int hcid_dbus_stop_device(uint16_t id)
release_passkey_agents(adapter, NULL);
+ if (adapter->agent) {
+ agent_release(adapter->agent);
+ agent_destroy(adapter->agent, FALSE);
+ adapter->agent = NULL;
+ }
+
if (adapter->discov_requestor) {
name_listener_remove(connection, adapter->discov_requestor,
(name_cb_t) discover_devices_req_exit,
@@ -981,6 +994,12 @@ void hcid_dbus_bonding_process_complete(bdaddr_t *local, bdaddr_t *peer,
release_passkey_agents(adapter, peer);
+ if (adapter->agent) {
+ agent_release(adapter->agent);
+ agent_destroy(adapter->agent, FALSE);
+ adapter->agent = NULL;
+ }
+
if (!adapter->bonding || bacmp(&adapter->bonding->bdaddr, peer))
return; /* skip: no bonding req pending */