main: exit 1 on memory leak detection

This commit is contained in:
Pierre Tachoire
2025-03-28 15:44:21 +01:00
parent fbe8086c98
commit cf015b2ce7

View File

@@ -52,7 +52,7 @@ pub fn main() !void {
const alloc = if (builtin.mode == .Debug) gpa.allocator() else std.heap.c_allocator;
defer if (builtin.mode == .Debug) {
_ = gpa.detectLeaks();
if (gpa.detectLeaks()) std.posix.exit(1);
};
var args_arena = std.heap.ArenaAllocator.init(alloc);