--- a/ui/gtk/container.c Sun Jan 05 17:41:39 2025 +0100 +++ b/ui/gtk/container.c Sun Jan 05 22:00:39 2025 +0100 @@ -971,7 +971,8 @@ int j = 0; while(elm) { CxHashKey key = cx_hash_key(&elm, sizeof(void*)); - UiObject *item_obj = cxMapRemoveAndGet(ct->current_items, key); + UiObject *item_obj = NULL; + cxMapRemoveAndGet(ct->current_items, key, &item_obj); if(item_obj) { g_object_ref(G_OBJECT(item_obj->widget)); BOX_REMOVE(ct->widget, item_obj->widget); @@ -982,7 +983,7 @@ } // ct->current_items only contains elements, that are not in the list - cxMapDestroy(ct->current_items); // calls destructor remove_item + cxMapFree(ct->current_items); // calls destructor remove_item ct->current_items = new_items; // add all items @@ -1021,7 +1022,7 @@ static void destroy_itemlist_container(GtkWidget *w, UiGtkItemListContainer *container) { container->remove_items = FALSE; - cxMapDestroy(container->current_items); + cxMapFree(container->current_items); free(container); }