summaryrefslogtreecommitdiffstats
path: root/binding
diff options
context:
space:
mode:
Diffstat (limited to 'binding')
-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);