diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2021-01-03 20:25:04 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2021-01-03 20:34:51 -0700 |
| commit | 404dc9692e33099cc59925d5cf03805224fcb36e (patch) | |
| tree | 0701332eab1d990a655ae9a6dcb3975d0b2c1737 /src/main.zig | |
| parent | 5c92e24a29ca403cc66515044a25d341a724f093 (diff) | |
| download | zig-404dc9692e33099cc59925d5cf03805224fcb36e.tar.gz zig-404dc9692e33099cc59925d5cf03805224fcb36e.zip | |
stage2: fix Cache debug deadlock code memory leak
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.zig b/src/main.zig index 155dcc74de..cf941104ab 100644 --- a/src/main.zig +++ b/src/main.zig @@ -104,7 +104,10 @@ pub fn log( var general_purpose_allocator = std.heap.GeneralPurposeAllocator(.{}){}; pub fn main() anyerror!void { - const gpa = if (std.builtin.link_libc) std.heap.raw_c_allocator else &general_purpose_allocator.allocator; + const gpa = if (std.builtin.link_libc) + std.heap.raw_c_allocator + else + &general_purpose_allocator.allocator; defer if (!std.builtin.link_libc) { _ = general_purpose_allocator.deinit(); }; @@ -3289,6 +3292,7 @@ fn detectNativeTargetInfo(gpa: *Allocator, cross_target: std.zig.CrossTarget) !s /// calls exit(0), and does not return. pub fn cleanExit() void { if (std.builtin.mode == .Debug) { + Cache.deinitDebugMap(); return; } else { process.exit(0); |
