Clear mesh event handlers in the mesh deinit time 95/240595/1
authorDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 10 Aug 2020 01:58:58 +0000 (10:58 +0900)
committerDoHyun Pyun <dh79.pyun@samsung.com>
Mon, 10 Aug 2020 01:58:58 +0000 (10:58 +0900)
Change-Id: I5c7bf72d4cf0930ff89ed4026ffdef9fa416bea2
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.c
bt-oal/bluez_hal/src/bt-hal-mesh-dbus-handler.h
bt-oal/bluez_hal/src/bt-hal-mesh.c

index 7dcad56..cfa12e8 100644 (file)
@@ -576,6 +576,21 @@ bool _bt_hal_mesh_stack_init(void)
        return true;
 }
 
+void _bt_hal_mesh_stack_deinit(void)
+{
+       INFO("Mesh: Stack Deinit");
+
+       if (client) {
+               l_dbus_client_destroy(client);
+               client = NULL;
+       }
+
+       if (dbus) {
+               l_dbus_destroy(dbus);
+               dbus = NULL;
+       }
+}
+
 /* To send stack event to hal-mesh handler */
 void _bt_hal_mesh_register_dbus_handler_cb(handle_stack_msg cb)
 {
index bf21e15..4015fc2 100644 (file)
@@ -42,6 +42,8 @@ void _bt_hal_mesh_unregister_dbus_handler_cb(void);
 
 bool _bt_hal_mesh_stack_init(void);
 
+void _bt_hal_mesh_stack_deinit(void);
+
 bt_status_t _bt_hal_mesh_create_network(bt_hal_mesh_node_t *node,
                GSList *models, bool is_prov);
 
index b434dd9..ff1b80d 100644 (file)
@@ -344,6 +344,8 @@ static void cleanup(void)
        _bt_hal_mesh_unregister_dbus_handler_cb();
        _bt_hal_unregister_event_handler_cb(HAL_MESH);
 
+       _bt_hal_mesh_stack_deinit();
+
        bt_hal_mesh_cbacks = NULL;
 }