From: Olaf Wintermann Date: Sun, 11 Jan 2026 12:09:27 +0000 (+0100) Subject: fix wrong allocator in update_sublists X-Git-Url: https://uap-core.de/gitweb/?a=commitdiff_plain;h=0acb15ed74b538d2ba9b8e9deba04ed0308b79c7;p=note.git fix wrong allocator in update_sublists --- diff --git a/application/window.c b/application/window.c index 12b7d11..4103013 100644 --- a/application/window.c +++ b/application/window.c @@ -192,8 +192,8 @@ void update_sublists(UiContext *ctx, UiList *sublists) { i = cxListIterator(notestore->root->children); cx_foreach(Resource *, col, i) { - UiSubList *sublist = calloc(1, sizeof(UiSubList)); - sublist->header = strdup(col->displayname ? col->displayname : col->nodename); + UiSubList *sublist = ui_calloc(ctx, 1, sizeof(UiSubList)); + sublist->header = ui_strdup(ctx, col->displayname ? col->displayname : col->nodename); sublist->value = ui_list_new(ctx, NULL); sublist->userdata = col; ui_list_append(sublists, sublist); @@ -211,8 +211,7 @@ void update_sublists(UiContext *ctx, UiList *sublists) { } // now we can free the list - delete_list->collection.advanced_destructor = (cx_destructor_func2)sublist_free; - delete_list->collection.destructor_data = ctx; + cxSetAdvancedDestructor(delete_list, (cx_destructor_func2)sublist_free, ctx); cxListFree(delete_list); }