Skip to content

Instantly share code, notes, and snippets.

@bzm3r
Created April 30, 2020 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bzm3r/fb299d9ff7a890b2d1508485b1cb6c6c to your computer and use it in GitHub Desktop.
Save bzm3r/fb299d9ff7a890b2d1508485b1cb6c6c to your computer and use it in GitHub Desktop.
impl Drop for ExampleBase {
fn drop(&mut self) {
unsafe {
self.device.device_wait_idle().unwrap();
self.device
.destroy_semaphore(self.present_complete_semaphore, None);
self.device
.destroy_semaphore(self.rendering_complete_semaphore, None);
self.device.free_memory(self.depth_image_memory, None);
self.device.destroy_image_view(self.depth_image_view, None);
self.device.destroy_image(self.depth_image, None);
for &image_view in self.present_image_views.iter() {
self.device.destroy_image_view(image_view, None);
}
self.device.destroy_command_pool(self.pool, None);
self.swapchain_loader
.destroy_swapchain(self.swapchain, None);
// self.device.destroy_device(None);
// self.surface_loader.destroy_surface(self.surface, None);
// self.debug_utils_loader
// .destroy_debug_utils_messenger(self.debug_call_back, None);
// self.instance.destroy_instance(None);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment