--- a/ui/cocoa/window.m Wed Oct 15 18:50:52 2025 +0200 +++ b/ui/cocoa/window.m Thu Oct 16 10:48:16 2025 +0200 @@ -38,16 +38,13 @@ #include "../common/context.h" #include "../common/menu.h" #include "../common/toolbar.h" +#include "../common/object.h" #include <cx/mempool.h> static UiObject* create_window(const char *title, BOOL simple, BOOL sidebar, BOOL splitview) { - CxMempool *mp = cxMempoolCreateSimple(256); - UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject)); - obj->ref = 0; - - obj->ctx = uic_context(obj, mp); + UiObject *obj = uic_object_new_toplevel(); MainWindow *window = [[MainWindow alloc] init:obj withSidebar:sidebar withSplitview:splitview]; [[WindowManager sharedWindowManager] addWindow:window];