mirror of
https://github.com/ziglang/zig.git
synced 2026-02-05 22:16:58 +00:00
std: fix windows resource leaks
This commit is contained in:
parent
a2fe81a639
commit
d8bdfd8192
@ -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;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user