Merge pull request #280 from lightpanda-io/cdpdump-close-dir

cdp: close dir in dumpFile
This commit is contained in:
Pierre Tachoire
2024-10-23 10:15:31 +02:00
committed by GitHub

View File

@@ -148,7 +148,8 @@ pub fn dumpFile(
) !void {
const name = try std.fmt.allocPrint(alloc, "id_{d}.js", .{id});
defer alloc.free(name);
const dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
var dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
defer dir.close();
const f = try dir.createFile(name, .{});
defer f.close();
const nb = try f.write(script);