OSDN Git Service

android/gatt: Cleanup bt_gatt_unregister function
authorSzymon Janc <szymon.janc@tieto.com>
Tue, 1 Apr 2014 11:55:38 +0000 (13:55 +0200)
committerSzymon Janc <szymon.janc@tieto.com>
Tue, 1 Apr 2014 12:06:28 +0000 (14:06 +0200)
This also fix memory leak when destroying gatt_clients queue.

android/gatt.c

index bfa43d3..75a80a5 100644 (file)
@@ -2127,15 +2127,15 @@ void bt_gatt_unregister(void)
 {
        DBG("");
 
-       queue_destroy(gatt_clients, free);
-
        ipc_unregister(hal_ipc, HAL_SERVICE_ID_GATT);
        hal_ipc = NULL;
 
+       queue_destroy(gatt_clients, destroy_gatt_client);
+       gatt_clients = NULL;
+
        queue_destroy(conn_list, destroy_device);
        conn_list = NULL;
 
        queue_destroy(conn_wait_queue, destroy_device);
        conn_wait_queue = NULL;
-
 }