diff --git a/wgpu-native/src/device.rs b/wgpu-native/src/device.rs index cdbe40086..0f0bf913f 100644 --- a/wgpu-native/src/device.rs +++ b/wgpu-native/src/device.rs @@ -775,10 +775,11 @@ impl Device { } } - pub(crate) fn destroy_self(self) { + pub(crate) fn dispose(self) { self.com_allocator.destroy(&self.raw); + let desc_alloc = self.desc_allocator.into_inner(); unsafe { - self.desc_allocator.lock().cleanup(&self.raw); + desc_alloc.dispose(&self.raw); } } } diff --git a/wgpu-native/src/hub.rs b/wgpu-native/src/hub.rs index 0e21b512d..f22a682a6 100644 --- a/wgpu-native/src/hub.rs +++ b/wgpu-native/src/hub.rs @@ -445,7 +445,7 @@ impl Drop for Hub { // self.adapters for (_, (device, _)) in devices.map.drain() { - device.destroy_self(); + device.dispose(); } } }