Merge branch 'bugfix/btdm_mem_leak_v3.2' into 'release/v3.2'

components/bt: Fix memory leak about rfcomm

See merge request espressif/esp-idf!5623
This commit is contained in:
Jiang Jiang Jian 2019-07-27 14:38:28 +08:00
commit 8fdea83505
3 changed files with 36 additions and 0 deletions

View file

@ -366,4 +366,9 @@ void BTE_DeinitStack(void)
#if (defined(A2D_INCLUDED) && A2D_INCLUDED == TRUE)
A2D_Deinit();
#endif
#if (defined(RFCOMM_INCLUDED) && RFCOMM_INCLUDED == TRUE)
RFCOMM_Deinit();
#endif
}

View file

@ -623,6 +623,17 @@ extern int PORT_Test (UINT16 handle, UINT8 *p_data, UINT16 len);
*******************************************************************************/
extern void RFCOMM_Init (void);
/*******************************************************************************
**
** Function RFCOMM_Deinit
**
** Description This function is called to deinitialize the control block
** for this layer.
**
** Returns void
**
*******************************************************************************/
extern void RFCOMM_Deinit(void);
/*******************************************************************************
**

View file

@ -1729,6 +1729,26 @@ void RFCOMM_Init (void)
rfcomm_l2cap_if_init ();
}
/*******************************************************************************
**
** Function RFCOMM_Deinit
**
** Description This function is called to deinitialize the control block
** for this layer.
**
** Returns void
**
*******************************************************************************/
void RFCOMM_Deinit(void)
{
#if RFC_DYNAMIC_MEMORY == TRUE
if (rfc_cb_ptr){
osi_free(rfc_cb_ptr);
rfc_cb_ptr = NULL;
}
#endif
}
/*******************************************************************************
**
** Function PORT_SetTraceLevel