fix a couple more memory leaks

This commit is contained in:
Mitchell Hashimoto
2022-10-24 16:17:18 -07:00
parent ef57e1e56a
commit bcf485342e
2 changed files with 6 additions and 0 deletions

View File

@ -632,6 +632,7 @@ pub fn destroy(self: *Window) void {
self.font_group.deinit(self.alloc); self.font_group.deinit(self.alloc);
self.font_lib.deinit(); self.font_lib.deinit();
self.alloc.destroy(self.font_group);
self.alloc_io_arena.deinit(); self.alloc_io_arena.deinit();
self.alloc.destroy(self.renderer_state.mutex); self.alloc.destroy(self.renderer_state.mutex);

View File

@ -171,6 +171,11 @@ pub const Set = struct {
/// The set of bindings. /// The set of bindings.
bindings: HashMap = .{}, bindings: HashMap = .{},
pub fn deinit(self: *Set, alloc: Allocator) void {
self.bindings.deinit(alloc);
self.* = undefined;
}
/// Add a binding to the set. If the binding already exists then /// Add a binding to the set. If the binding already exists then
/// this will overwrite it. /// this will overwrite it.
pub fn put(self: *Set, alloc: Allocator, t: Trigger, action: Action) !void { pub fn put(self: *Set, alloc: Allocator, t: Trigger, action: Action) !void {