fixed memory leak for ble_hs_flow_timer and ble_hs_stop_terminate_tmo

This commit is contained in:
wangmengyang
2022-02-11 18:56:43 +05:30
committed by Rahul Tank
parent 30bdc185ae
commit ff9ebc925b
5 changed files with 20 additions and 1 deletions
+4
View File
@@ -841,4 +841,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);
}