DVUI

deinit

Free any strings allocated by struct_ui.

gpa must be the same allocator as passed to dvui.Window.init().

Parameters

#
gpa:std.mem.Allocator
std.mem.Allocator

Source

Implementation

#
pub fn deinit(gpa: std.mem.Allocator) void {
    var itr = string_map.iterator();
    while (itr.next()) |entry| {
        if (defaults.string_allocator) |string_alloc| {
            string_alloc.free(entry.value_ptr.*);
        } else {
            gpa.free(entry.value_ptr.*);
        }
    }
    string_map.clearAndFree(gpa);
}