diff --git a/src/platform/native.zig b/src/platform/native.zig index 4e65b2ec..d79cf8c2 100644 --- a/src/platform/native.zig +++ b/src/platform/native.zig @@ -603,6 +603,7 @@ pub fn main() !void { pub fn coreInit(allocator: std.mem.Allocator) !*Core { const core: *Core = try allocator.create(Core); + errdefer allocator.destroy(core); core.* = try Core.init(allocator); // Glfw specific: initialize the user pointer used in callbacks