components/bt: Fix memory leak about rfcomm

This commit is contained in:
baohongde 2019-07-25 16:22:50 +08:00
parent a33c5f1713
commit ba7a0fa4ec
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