diff -r f0def0c24ae6 -r 5e9bc6428bac ui/common/context.c --- a/ui/common/context.c Tue May 19 18:25:53 2026 +0200 +++ b/ui/common/context.c Tue May 19 18:31:16 2026 +0200 @@ -97,6 +97,15 @@ cxListAdd(ctx->destroy_handler, &handler); } +void uic_context_remove_destructor(UiContext *ctx, void *data) { + CxIterator i = cxListIterator(ctx->destroy_handler); + cx_foreach(UiDestroyHandler *, handler, i) { + if(handler->data == data) { + cxIteratorFlagRemoval(i); + } + } +} + void uic_context_prepare_close(UiContext *ctx) { cxListClear(ctx->states); cxListClear(ctx->state_widgets); @@ -733,6 +742,10 @@ uic_context_add_destructor(ctx, destr, data); } +void ui_remove_destructor(UiContext *ctx, void *data) { + uic_context_remove_destructor(ctx, data); +} + void ui_set_destructor(void *mem, ui_destructor_func destr) { cxMempoolSetDestructor(mem, (cx_destructor_func)destr); }