From 711e748eb33e5796293f5bb37a1c957c24c39c65 Mon Sep 17 00:00:00 2001 From: Jakub Tyszkowski Date: Wed, 11 Feb 2015 15:34:00 +0100 Subject: [PATCH] android/gatt: Destroy app connections before destroying apps This is the right destruction order to avoid dangling pointers. And it will actually matter when we make app connection destructor automatically notify apps about disconnection. --- android/gatt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/android/gatt.c b/android/gatt.c index b0ce1a8b4..f9cef4f54 100644 --- a/android/gatt.c +++ b/android/gatt.c @@ -7284,12 +7284,12 @@ void bt_gatt_unregister(void) ipc_unregister(hal_ipc, HAL_SERVICE_ID_GATT); hal_ipc = NULL; - queue_destroy(gatt_apps, destroy_gatt_app); - gatt_apps = NULL; - queue_destroy(app_connections, destroy_connection); app_connections = NULL; + queue_destroy(gatt_apps, destroy_gatt_app); + gatt_apps = NULL; + queue_destroy(gatt_devices, destroy_device); gatt_devices = NULL; -- 2.47.3