Skip to content

Commit

Permalink
cdp: close dir in dumpFile
Browse files Browse the repository at this point in the history
and avoid error.ProcessFdQuotaExceeded error
  • Loading branch information
krichprollsch committed Oct 23, 2024
1 parent b3ac313 commit 5d7796b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cdp/cdp.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5d7796b

Please sign in to comment.