Solve a sharing violation on windows

On windows because we fail to close the output_file, when the compiler 
goes to open it when reading the file during compiling the actual app it
encounters a sharing violation. This change closes the file, fixing that issue
This commit is contained in:
Rageoholic
2020-07-21 08:11:42 -05:00
committed by GitHub
parent 964ad1c0f9
commit 574e49277a

View File

@@ -53,6 +53,7 @@ pub const GenerateStep = struct {
const dir = path.dirname(self.full_out_path).?; const dir = path.dirname(self.full_out_path).?;
try cwd.makePath(dir); try cwd.makePath(dir);
const output_file = cwd.createFile(self.full_out_path, .{}) catch unreachable; const output_file = cwd.createFile(self.full_out_path, .{}) catch unreachable;
defer output_file.close();
_ = try std.zig.render(self.builder.allocator, output_file.outStream(), tree); _ = try std.zig.render(self.builder.allocator, output_file.outStream(), tree);
} }
}; };