forked from mirror/vulkan-zig
example: really resolve swapchain memory leak this time
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user