mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-31 11:17:20 +02:00
freertos: portCLEAN_UP_TCB should be performed before freeing tcb memory
Signed-off-by: Mahavir Jain <mahavir@espressif.com>
This commit is contained in:
@ -3878,6 +3878,10 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
|||||||
|
|
||||||
static void prvDeleteTCB( TCB_t *pxTCB )
|
static void prvDeleteTCB( TCB_t *pxTCB )
|
||||||
{
|
{
|
||||||
|
/* This call is required for any port specific cleanup related to task.
|
||||||
|
It must be above the vPortFree() calls. */
|
||||||
|
portCLEAN_UP_TCB( pxTCB );
|
||||||
|
|
||||||
/* Free up the memory allocated by the scheduler for the task. It is up
|
/* Free up the memory allocated by the scheduler for the task. It is up
|
||||||
to the task to free any memory allocated at the application level. */
|
to the task to free any memory allocated at the application level. */
|
||||||
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
#if ( configUSE_NEWLIB_REENTRANT == 1 )
|
||||||
@ -3920,7 +3924,6 @@ BaseType_t xTaskGetAffinity( TaskHandle_t xTask )
|
|||||||
/* Neither the stack nor the TCB were allocated dynamically, so
|
/* Neither the stack nor the TCB were allocated dynamically, so
|
||||||
nothing needs to be freed. */
|
nothing needs to be freed. */
|
||||||
configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
|
configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
|
||||||
portCLEAN_UP_TCB( pxTCB );
|
|
||||||
mtCOVERAGE_TEST_MARKER();
|
mtCOVERAGE_TEST_MARKER();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user