fix ui_document_new creating a wrong self_doc ptr default tip

Sun, 24 May 2026 20:44:08 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 24 May 2026 20:44:08 +0200
changeset 1141
e37824dd7281
parent 1140
85fef17b0105

fix ui_document_new creating a wrong self_doc ptr

ui/common/document.c file | annotate | diff | comparison | revisions
--- a/ui/common/document.c	Sun May 24 16:47:27 2026 +0200
+++ b/ui/common/document.c	Sun May 24 20:44:08 2026 +0200
@@ -45,8 +45,8 @@
     
     UiDoc *document = cxCalloc(a, sizeof(UiDoc) + size, 1);
     document->ctx = ctx;
-    ctx->self_doc = document;
-    return &document->doc;
+    ctx->self_doc = &document->doc;
+    return ctx->self_doc;
 }
 
 void ui_document_destroy(void *doc) {

mercurial