{mach,gpu}: add autorelease pool

Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
This commit is contained in:
Stephen Gutekanst 2022-08-16 17:05:15 -07:00
parent f366244a9a
commit 68d5f6fcb1
4 changed files with 55 additions and 1 deletions

View file

@ -142,6 +142,9 @@ const FrameParams = struct {
};
fn frame(params: FrameParams) !void {
const pool = try sample_utils.AutoReleasePool.init();
defer sample_utils.AutoReleasePool.release(pool);
try glfw.pollEvents();
const pl = params.window.getUserPointer(WindowData).?;
if (pl.swap_chain == null or !std.meta.eql(pl.current_desc, pl.target_desc)) {