std: fix windows resource leaks

This commit is contained in:
Jacob Young authored and Andrew Kelley committed 2023-04-24 16:50:44 -07:00
1 parent a2fe81a639
commit d8bdfd8192
2 files changed
+3

No files matched your search

+1
View File
@@ -1236,6 +1236,7 @@ pub const Dir = struct {
.capable_io_mode = std.io.default_mode,
.intended_io_mode = flags.intended_io_mode,
};
errdefer file.close();
var io: w.IO_STATUS_BLOCK = undefined;
const range_off: w.LARGE_INTEGER = 0;
const range_len: w.LARGE_INTEGER = 1;
+2
View File
@@ -1101,6 +1101,8 @@ test "isatty" {
defer tmp.cleanup();
var file = try tmp.dir.createFile("foo", .{});
defer file.close();
try expectEqual(os.isatty(file.handle), false);
}