Always destroy surface
This commit is contained in:
parent
873469378d
commit
abc8c6ccfc
1 changed files with 1 additions and 5 deletions
|
@ -8,7 +8,6 @@ const UNORM_FORMATS: [VkFormat; 2] = [VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_B8G8R8
|
|||
|
||||
#[derive(Debug)]
|
||||
pub struct Surface {
|
||||
external_source: bool,
|
||||
instance: Arc<Instance>,
|
||||
surface: VkSurfaceKHR,
|
||||
}
|
||||
|
@ -16,7 +15,6 @@ pub struct Surface {
|
|||
impl Surface {
|
||||
pub fn from_vk_surface(surface: VkSurfaceKHR, instance: &Arc<Instance>) -> Arc<Surface> {
|
||||
Arc::new(Surface {
|
||||
external_source: true,
|
||||
instance: instance.clone(),
|
||||
surface,
|
||||
})
|
||||
|
@ -73,8 +71,6 @@ impl_vk_handle!(Surface, VkSurfaceKHR, surface);
|
|||
|
||||
impl Drop for Surface {
|
||||
fn drop(&mut self) {
|
||||
if !self.external_source {
|
||||
self.instance.destroy_surface(self.surface)
|
||||
}
|
||||
self.instance.destroy_surface(self.surface)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue