diff options
Diffstat (limited to 'core/Term.zig')
| -rw-r--r-- | core/Term.zig | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/core/Term.zig b/core/Term.zig index 116c1118..ce462d81 100644 --- a/core/Term.zig +++ b/core/Term.zig @@ -79,8 +79,8 @@ pub const State = struct { } /// What `dumpRead` made, freed: a load that failed after it. - pub fn dumpFree(s: *State, gpa: std.mem.Allocator) void { - the().close(s.impl, gpa); + pub fn dumpFree(s: *State, _: std.mem.Allocator) void { + the().close(s.impl); } pub fn dumpRead(out: *State, gpa: std.mem.Allocator, bytes: []const u8) !void { @@ -115,10 +115,11 @@ pub fn open(gpa: std.mem.Allocator, cols: u16, rows: u16) !*State { return s; } -/// It and what it holds, freed; the kitty images' caches were `gpa`'s. -pub fn close(s: *State, gpa: std.mem.Allocator) void { +/// It and what it holds, freed, all of it with its own allocator (the +/// one it was opened with): the allocator a caller hands is not used. +pub fn close(s: *State, _: std.mem.Allocator) void { const own = the().gpa(s.impl); - the().close(s.impl, gpa); + the().close(s.impl); own.destroy(s); } |
