ui/common/document.c

changeset 97
5a3d27b8e6b0
parent 77
5de33c2d94c6
--- a/ui/common/document.c	Wed Nov 27 18:53:11 2024 +0100
+++ b/ui/common/document.c	Thu Nov 28 18:03:12 2024 +0100
@@ -86,12 +86,13 @@
     CxMempool *mp = cxMempoolCreate(256, NULL);
     const CxAllocator *a = mp->allocator;
     UiContext *ctx = cxCalloc(a, 1, sizeof(UiContext));
+    ctx->mp = mp;
     ctx->attach_document = uic_context_attach_document;
     ctx->detach_document2 = uic_context_detach_document2;
     ctx->allocator = a;
     ctx->vars = cxHashMapCreate(a, CX_STORE_POINTERS, 16);
     
-    void *document = cxCalloc(a, 1, size);
+    void *document = cxCalloc(a, size, 1);
     cxMapPut(documents, cx_hash_key(&document, sizeof(void*)), ctx);
     return document;
 }

mercurial