From 08c0460e32aa678f3b5bc0abf35b543d07dc246e Mon Sep 17 00:00:00 2001 From: Connor Fitzgerald Date: Thu, 4 Jun 2020 23:42:59 -0400 Subject: [PATCH] Add assert that old SwapChainOutput is dead after SwapChain is remade --- wgpu-core/src/device/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 2392ec7b8b..10024a15ad 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -2288,6 +2288,10 @@ impl Global { let sc_id = surface_id.to_swap_chain_id(B::VARIANT); if let Some(sc) = swap_chain_guard.remove(sc_id) { + assert!( + sc.acquired_view_id.is_none(), + "SwapChainOutput must be dropped before a new SwapChain is made." + ); unsafe { device.raw.destroy_semaphore(sc.semaphore); }