]> git.sur5r.net Git - freertos/commitdiff
Ensure xNewLib_reent is reclaimed when a task is deleted.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 9 Apr 2014 09:07:19 +0000 (09:07 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 9 Apr 2014 09:07:19 +0000 (09:07 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2234 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/tasks.c

index c20aeed54043a8aa8fcaeac21ce055970b33a1ba..60d62b09a33600c5a3ea6876ed73a307ef3da3d9 100644 (file)
@@ -3086,8 +3086,13 @@ TCB_t *pxNewTCB;
                want to allocate and clean RAM statically. */\r
                portCLEAN_UP_TCB( pxTCB );\r
 \r
-               /* Free up the memory allocated by the scheduler for the task.  It is up to\r
-               the task to free any memory allocated at the application level. */\r
+               /* Free up the memory allocated by the scheduler for the task.  It is up\r
+               to the task to free any memory allocated at the application level. */\r
+               #if ( configUSE_NEWLIB_REENTRANT == 1 )\r
+               {\r
+                       _reclaim_reent( &( pxTCB->xNewLib_reent ) );\r
+               }\r
+               #endif /* configUSE_NEWLIB_REENTRANT */\r
                vPortFreeAligned( pxTCB->pxStack );\r
                vPortFree( pxTCB );\r
        }\r