This prevents non-PAN Bluetooth connections from being disconnected
when ConnMan quits. PAN connections are disconnected normally.
---
 plugins/bluetooth.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c
index dd56e90..bf985cb 100644
--- a/plugins/bluetooth.c
+++ b/plugins/bluetooth.c
@@ -45,6 +45,7 @@ static GDBusClient *client;
 static GHashTable *devices;
 static GHashTable *networks;
 static bool bluetooth_tethering;
+static bool shutting_down;
 
 struct bluetooth_pan {
        struct connman_network *network;
@@ -567,7 +568,7 @@ static int bluetooth_device_disable(struct connman_device 
*device)
        dbus_bool_t device_powered = FALSE;
        const char *path;
 
-       if (!proxy)
+       if (!proxy || shutting_down)
                return 0;
 
        path = g_dbus_proxy_get_path(proxy);
@@ -941,6 +942,8 @@ out:
 
 static void bluetooth_exit(void)
 {
+       shutting_down = true;
+
        connman_network_driver_unregister(&network_driver);
        g_hash_table_destroy(networks);
 
-- 
1.7.11.7

_______________________________________________
connman mailing list
[email protected]
https://lists.connman.net/mailman/listinfo/connman

Reply via email to