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:
@@ -5,7 +5,9 @@ const WindowContext = @import("WindowContext.zig");
|
|||||||
const ui = @import("ui/frame.zig");
|
const ui = @import("ui/frame.zig");
|
||||||
|
|
||||||
pub fn main() !void {
|
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();
|
const allocator = gpa.allocator();
|
||||||
|
|
||||||
var backend = try SDLBackend.initWindow(.{
|
var backend = try SDLBackend.initWindow(.{
|
||||||
|
|||||||
Reference in New Issue
Block a user