--- a/ui/common/wrapper.c Tue May 19 18:45:56 2026 +0200 +++ b/ui/common/wrapper.c Wed May 20 19:38:54 2026 +0200 @@ -50,6 +50,22 @@ obj->onclosedata = userdata; } +static int obj_unref(void *ptr) { + ui_object_unref(ptr); +} + +void ui_mainthread_object_unref(UiObject *obj) { + ui_call_mainthread(obj_unref, obj); +} + +static int doc_unref(void *ptr) { + ui_document_unref(ptr); +} + +void ui_mainthread_document_unref(void *doc) { + ui_call_mainthread(doc_unref, doc); +} + /* ---------------------------- UiList ---------------------------- */