mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-16 08:42:28 +00:00
btstack_tlv_posix: add btstack_tlv_posix_deinit
This commit is contained in:
parent
ac51aada34
commit
4129d206a9
@ -264,3 +264,17 @@ const btstack_tlv_t * btstack_tlv_posix_init_instance(btstack_tlv_posix_t * self
|
|||||||
return &btstack_tlv_posix;
|
return &btstack_tlv_posix;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free TLV entries
|
||||||
|
* @param self
|
||||||
|
*/
|
||||||
|
void btstack_tlv_posix_deinit(btstack_tlv_posix_t * self){
|
||||||
|
// free all entries
|
||||||
|
btstack_linked_list_iterator_t it;
|
||||||
|
btstack_linked_list_iterator_init(&it, &self->entry_list);
|
||||||
|
while (btstack_linked_list_iterator_has_next(&it)){
|
||||||
|
tlv_entry_t * entry = (tlv_entry_t*) btstack_linked_list_iterator_next(&it);
|
||||||
|
btstack_linked_list_iterator_remove(&it);
|
||||||
|
free(entry);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -61,6 +61,12 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
const btstack_tlv_t * btstack_tlv_posix_init_instance(btstack_tlv_posix_t * context, const char * db_path);
|
const btstack_tlv_t * btstack_tlv_posix_init_instance(btstack_tlv_posix_t * context, const char * db_path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Free TLV entries
|
||||||
|
* @param self
|
||||||
|
*/
|
||||||
|
void btstack_tlv_posix_deinit(btstack_tlv_posix_t * self);
|
||||||
|
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user