If I have a type that I need to call deinit on to free the memory it allocates, does array_list.deinit() free the memory the type allocated? Or do I have to do something as shown in the code block?
var output = std.ArrayList(T).init(allocator);
errdefer {
var objects = output.toOwnedSlice();
for (objects) |object| object.deinit(allocator);
allocator.free(objects);
}
Thanks!