Skip to content

Commit

Permalink
- add autorelease pool for macos
Browse files Browse the repository at this point in the history
  • Loading branch information
polymonster committed Jun 5, 2024
1 parent bbc2185 commit a8b7e2b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/gfx/mtl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,11 @@ impl super::SwapChain<Device> for SwapChain {
}

fn swap(&mut self, device: &Device) {
let cmd = device.command_queue.new_command_buffer();
cmd.present_drawable(&self.drawable);
cmd.commit();
objc::rc::autoreleasepool(|| {
let cmd = device.command_queue.new_command_buffer();
cmd.present_drawable(&self.drawable);
cmd.commit();
});
}
}

Expand Down

0 comments on commit a8b7e2b

Please sign in to comment.