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

@@ -171,6 +171,11 @@ pub const Set = struct {
/// The set of bindings.
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
/// this will overwrite it.
pub fn put(self: *Set, alloc: Allocator, t: Trigger, action: Action) !void {