docs/Writerside/topics/mempool.h.md

changeset 1696
976e629ce990
parent 1694
a2757c6427cc
--- a/docs/Writerside/topics/mempool.h.md	Wed Dec 31 16:05:38 2025 +0100
+++ b/docs/Writerside/topics/mempool.h.md	Wed Dec 31 16:18:48 2025 +0100
@@ -164,15 +164,14 @@
     cxMempoolRegister(pool, f, (cx_destructor_func) fclose);
 
     // create a buffer using the memory pool for destruction
-    CxBuffer *content = cxBufferCreate(
-            NULL, 256, pool->allocator, CX_BUFFER_AUTO_EXTEND
+    CxBuffer *content = cxBufferCreate(pool->allocator,
+            NULL, 256, CX_BUFFER_AUTO_EXTEND
     );
 
     // read the file into the buffer and turn it into a string
     cx_stream_copy(
         f, content, (cx_read_func) fread, cxBufferWriteFunc
     );
-    fclose(f);
     cxstring contentstr = cx_bstr(content);
 
     // split the string into lines
@@ -185,7 +184,7 @@
     // skip the header and parse the remaining data into a linked list
     // the nodes of the list shall also be allocated by the pool
     CxList* datalist = cxLinkedListCreate(
-        pool->allocator, NULL, sizeof(CSVData)
+        pool->allocator, sizeof(CSVData)
     );
     for (size_t i = 1 ; i < lc ; i++) {
         if (lines[i].length == 0) continue;

mercurial