Skip to content

Commit a34f2e9

Browse files
committed
main: exit 1 on memory leak detection
1 parent 679d9f1 commit a34f2e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub fn main() !void {
5252
const alloc = if (builtin.mode == .Debug) gpa.allocator() else std.heap.c_allocator;
5353

5454
defer if (builtin.mode == .Debug) {
55-
_ = gpa.detectLeaks();
55+
if (gpa.detectLeaks()) std.posix.exit(1);
5656
};
5757

5858
var args_arena = std.heap.ArenaAllocator.init(alloc);

0 commit comments

Comments
 (0)