From d2328aaf13b9c2845b373fb4476a9d0741437a3a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 29 Oct 2018 15:13:25 +0200 Subject: [PATCH] gatt: Fix not removing disconnect handler properly Previous patch did not really fixed the crash since the bt_server would be freed already which makes bt_att instance to be passed as NULL to bt_att_unregister_disconnect which makes it not the take the expected action. --- src/device.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/device.c b/src/device.c index 024e670e0..60b991c1b 100644 --- a/src/device.c +++ b/src/device.c @@ -578,11 +578,11 @@ static void gatt_server_cleanup(struct btd_device *device) if (!device->server) return; - bt_gatt_server_unref(device->server); - device->server = NULL; - btd_gatt_database_att_disconnected( btd_adapter_get_database(device->adapter), device); + + bt_gatt_server_unref(device->server); + device->server = NULL; } static void attio_cleanup(struct btd_device *device) -- 2.47.3