diff -r 85fef17b0105 -r e37824dd7281 ui/common/document.c --- 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) {