summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaquel Medina <raquel.medina@konsulko.com>2020-07-09 12:19:00 +0200
committerRaquel Medina <raquel.medina@konsulko.com>2020-07-09 12:22:20 +0200
commitd542c5ce356117a96907763c963128208105f947 (patch)
tree722b90c4f924d6e9b52435c3bcebb2d24b3a8e0d
parent13c9a3287314d9cde35dcb47a3fa0978bd6847d1 (diff)
unregister agent if previously registered
Only unregister agent on exit path if it had been registered beforehand. Bug-AGL: SPEC-3301 Signed-off-by: Raquel Medina <raquel.medina@konsulko.com> Change-Id: I60fc2af01800521e0d5b026dbf7404b445eff6f9
-rw-r--r--binding/bluetooth-api.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/binding/bluetooth-api.c b/binding/bluetooth-api.c
index ddf5dfd..2309ef6 100644
--- a/binding/bluetooth-api.c
+++ b/binding/bluetooth-api.c
@@ -663,7 +663,8 @@ static gpointer bluetooth_func(gpointer ptr)
g_main_loop_unref(ns->loop);
- bluetooth_unregister_agent(ns);
+ if (ns->agent_path)
+ bluetooth_unregister_agent(ns);
bluetooth_cleanup(ns);
afb_api_set_userdata(id->api, NULL);