- for (l = svc_info->char_data; l != NULL; l = l->next) {
- struct gatt_char_info *char_info = l->data;
-
- if (char_info == NULL)
- break;
-
- for (l1 = char_info->desc_data; l1 != NULL; l1 = l1->next) {
- struct gatt_desc_info *desc_info = l1->data;
-
- if (desc_info == NULL)
- break;
-
- ret = g_dbus_connection_unregister_object(g_conn,
- desc_info->desc_id);
- if (ret) {
- __bt_gatt_emit_interface_removed(
- desc_info->desc_path,
- GATT_DESC_INTERFACE);
- } else {
- err = BLUETOOTH_ERROR_INTERNAL;
- }
-
- /* list remove & free */
- char_info->desc_data = g_slist_remove(char_info->desc_data, desc_info);
- __bt_gatt_free_descriptor_info(desc_info);
- }
-
- g_slist_free(char_info->desc_data);
- char_info->desc_data = NULL;
-
- ret = g_dbus_connection_unregister_object(g_conn,
- char_info->char_id);
- if (ret) {
- __bt_gatt_emit_interface_removed(char_info->char_path,
- GATT_CHAR_INTERFACE);
- } else {
- err = BLUETOOTH_ERROR_INTERNAL;
- }
-
- /* list remove & free */
- svc_info->char_data = g_slist_remove(svc_info->char_data, char_info);
- __bt_gatt_free_characteristic_info(char_info);
- }
-