[PATCH 02/10] android/gatt: Destroy app connections before destroying apps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 b0ce1a8..f9cef4f 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;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux