diff --git a/src/image.zig b/src/image.zig index 2d40b97..51c1eef 100644 --- a/src/image.zig +++ b/src/image.zig @@ -179,8 +179,9 @@ pub const Image = struct { } pub fn close(self: *Image) void { - //self.allocator.free(self.path); - //self.allocator.free(self.curpath); + self.allocator.free(self.path); + self.allocator.free(self.curpath); + var st: i32 = c.sf_close(self.sndfile); if (st != 0) { diff --git a/src/runner.zig b/src/runner.zig index 37fade3..47f2cab 100644 --- a/src/runner.zig +++ b/src/runner.zig @@ -78,6 +78,7 @@ pub const Runner = struct { } } + // Caller owns returned memory. fn resolveArgPath(self: *Runner, path_or_argidx: []const u8) ![]const u8 { const path = try self.resolveArg(path_or_argidx); const resolved_path = try std.fs.path.resolve( @@ -89,7 +90,7 @@ pub const Runner = struct { } fn loadCmd(self: *Runner, path_or_argidx: []const u8) !void { - var load_path = try self.resolveArgPath(path_or_argidx); + const load_path = try self.resolveArgPath(path_or_argidx); std.debug.warn("\tload path: {}\n", .{load_path}); // we could use ImageMagick to convert from X to BMP