Skip to content

Commit 5d7796b

Browse files
committed
cdp: close dir in dumpFile
and avoid error.ProcessFdQuotaExceeded error
1 parent b3ac313 commit 5d7796b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/cdp/cdp.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ pub fn dumpFile(
148148
) !void {
149149
const name = try std.fmt.allocPrint(alloc, "id_{d}.js", .{id});
150150
defer alloc.free(name);
151-
const dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
151+
var dir = try std.fs.cwd().makeOpenPath("zig-cache/tmp", .{});
152+
defer dir.close();
152153
const f = try dir.createFile(name, .{});
153154
defer f.close();
154155
const nb = try f.write(script);

0 commit comments

Comments
 (0)