fixed memory leak for ble_hs_flow_timer and ble_hs_stop_terminate_tmo

This commit is contained in:
wangmengyang
2021-12-17 15:40:07 +08:00
committed by Wang Mengyang
parent 8869cf6ba6
commit 554cd264cd
5 changed files with 20 additions and 1 deletions
+4
View File
@@ -830,4 +830,8 @@ ble_hs_deinit(void)
ble_gap_deinit();
ble_hs_hci_deinit();
ble_hs_flow_stop();
ble_hs_stop_deinit();
}
+8
View File
@@ -273,3 +273,11 @@ ble_hs_flow_startup(void)
return 0;
}
void
ble_hs_flow_stop(void)
{
#if MYNEWT_VAL(BLE_HS_FLOW_CTRL)
ble_npl_callout_deinit(&ble_hs_flow_timer);
#endif
}
+1 -1
View File
@@ -28,7 +28,7 @@ extern "C" {
void ble_hs_flow_connection_broken(uint16_t conn_handle);
void ble_hs_flow_track_data_mbuf(struct os_mbuf *om);
int ble_hs_flow_startup(void);
void ble_hs_flow_stop(void);
#ifdef __cplusplus
}
#endif
+1
View File
@@ -132,6 +132,7 @@ void ble_hs_timer_resched(void);
void ble_hs_notifications_sched(void);
struct ble_npl_eventq *ble_hs_evq_get(void);
void ble_hs_stop_init(void);
void ble_hs_stop_deinit(void);
struct ble_mqueue {
STAILQ_HEAD(, os_mbuf_pkthdr) head;
+6
View File
@@ -281,3 +281,9 @@ ble_hs_stop_init(void)
ble_hs_stop_terminate_timeout_cb, NULL);
#endif
}
void
ble_hs_stop_deinit(void)
{
ble_npl_callout_deinit(&ble_hs_stop_terminate_tmo);
}