Use leak detection of DebugAllocator.

When allocating memory it remebers where memory was allocated but it only
for leaks in .deinit(). So not calling it is a sure way to miss a bunch of leaks.

deinit() returns if it found leaks but we don't really care. Its usefull for tests but not here.
This commit is contained in:
andrew.kraevskii
2026-03-04 01:43:59 +03:00
parent b0259c5788
commit 045624beac

View File

@@ -5,7 +5,9 @@ const WindowContext = @import("WindowContext.zig");
const ui = @import("ui/frame.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
// std.heap.GeneralPurposeAllocator was renamed to DebugAllocator recently.
var gpa: std.heap.DebugAllocator(.{}) = .init;
defer _ = gpa.deinit();
const allocator = gpa.allocator();
var backend = try SDLBackend.initWindow(.{