# HG changeset patch
# User Olaf Wintermann <olaf.wintermann@gmail.com>
# Date 1732813531 -3600
# Node ID 4d87a137fe707644a972ab2b17ba5f8f92160bab
# Parent  6d4adf6fba1f7055fca90a56ab0f0c30d8baadee
fix missing mempool in document context

diff -r 6d4adf6fba1f -r 4d87a137fe70 ui/common/document.c
--- a/ui/common/document.c	Thu Nov 28 18:04:55 2024 +0100
+++ b/ui/common/document.c	Thu Nov 28 18:05:31 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;
 }