example: really resolve swapchain memory leak this time

This commit is contained in:
Robin Voetter
2022-02-08 12:36:38 +01:00
parent 7b80166108
commit 9607e97fe9
2 changed files with 4 additions and 2 deletions

View File

@@ -56,7 +56,9 @@ pub fn main() !void {
) orelse return error.WindowInitFailed;
defer c.glfwDestroyWindow(window);
const allocator = std.heap.page_allocator;
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
defer _ = gpa.deinit();
const allocator = gpa.allocator();
const gc = try GraphicsContext.init(allocator, app_name, window);
defer gc.deinit();