ui/common/document.c

changeset 102
64ded9f6a6c6
parent 101
7b3a3130be44
--- a/ui/common/document.c	Mon Jan 06 22:22:55 2025 +0100
+++ b/ui/common/document.c	Tue Feb 25 21:11:00 2025 +0100
@@ -85,12 +85,7 @@
 void* ui_document_new(size_t size) {
     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);
+    UiContext *ctx = uic_context(NULL, mp);
     
     void *document = cxCalloc(a, size, 1);
     cxMapPut(documents, cx_hash_key(&document, sizeof(void*)), ctx);

mercurial