ui/common/context.c

changeset 875
0575ca45f1bb
parent 813
6d9066951cdb
child 885
28ecfe5399ae
--- a/ui/common/context.c	Sat Oct 25 21:30:41 2025 +0200
+++ b/ui/common/context.c	Sun Oct 26 10:07:31 2025 +0100
@@ -622,7 +622,7 @@
     return ctx ? cxRealloc(ctx->allocator, ptr, size) : NULL;
 }
 
-UIEXPORT char* ui_strdup(UiContext *ctx, const char *str) {
+char* ui_strdup(UiContext *ctx, const char *str) {
     if(!ctx) {
         return NULL;
     }
@@ -630,3 +630,11 @@
     cxmutstr d = cx_strdup_a(ctx->allocator, s);
     return d.ptr;
 }
+
+void  ui_reg_destructor(UiContext *ctx, void *data, ui_destructor_func destr) {
+    cxMempoolRegister(ctx->mp, data, (cx_destructor_func)destr);
+}
+
+void  ui_set_destructor(void *mem, ui_destructor_func destr) {
+    cxMempoolSetDestructor(mem, (cx_destructor_func)destr);
+}

mercurial