]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-TCP/FreeRTOS_TCP_WIN.c
Update version number in +TCP code.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-TCP / FreeRTOS_TCP_WIN.c
index 11dc00f01db16e1fd862361444c1a403aaf289ad..93fde9590831954ba0872913d66e0d50424ae9f4 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
- * FreeRTOS+TCP V2.0.7\r
+ * FreeRTOS+TCP V2.0.11\r
  * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
  *\r
  * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
@@ -199,7 +199,7 @@ extern void vListInsertGeneric( List_t * const pxList, ListItem_t * const pxNewL
 \r
 /*-----------------------------------------------------------*/\r
 \r
-/* TCP segement pool. */\r
+/* TCP segment pool. */\r
 #if( ipconfigUSE_TCP_WIN == 1 )\r
        static TCPSegment_t *xTCPSegments = NULL;\r
 #endif /* ipconfigUSE_TCP_WIN == 1 */\r
@@ -673,6 +673,23 @@ const int32_t l500ms = 500;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+#if( ipconfigUSE_TCP_WIN == 1 )\r
+\r
+    void vTCPSegmentCleanup( void )\r
+    {\r
+        /* Free and clear the TCP segments pointer. This function should only be called\r
+         * once FreeRTOS+TCP will no longer be used. No thread-safety is provided for this\r
+         * function. */\r
+        if( xTCPSegments != NULL )\r
+        {\r
+            vPortFreeLarge( xTCPSegments );\r
+            xTCPSegments = NULL;\r
+        }\r
+    }\r
+\r
+#endif /* ipconfgiUSE_TCP_WIN == 1 */\r
+/*-----------------------------------------------------------*/\r
+\r
 /*=============================================================================\r
  *\r
  *                ######        #    #\r