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

@@ -101,6 +101,7 @@ pub const Swapchain = struct {
fn deinitExceptSwapchain(self: Swapchain) void {
for (self.swap_images) |si| si.deinit(self.gc);
self.allocator.free(self.swap_images);
self.gc.vkd.destroySemaphore(self.gc.dev, self.next_image_acquired, null);
}
@@ -110,7 +111,6 @@ pub const Swapchain = struct {
pub fn deinit(self: Swapchain) void {
self.deinitExceptSwapchain();
self.allocator.free(self.swap_images);
self.gc.vkd.destroySwapchainKHR(self.gc.dev, self.handle, null);
}