diff --git a/wgpu-core/src/instance.rs b/wgpu-core/src/instance.rs index 175baa7d0..fc74444b1 100644 --- a/wgpu-core/src/instance.rs +++ b/wgpu-core/src/instance.rs @@ -1043,16 +1043,7 @@ impl Global { api_log!("Adapter::drop {adapter_id:?}"); let hub = A::hub(self); - let mut adapters_locked = hub.adapters.write(); - - let free = match adapters_locked.get(adapter_id) { - Ok(adapter) => Arc::strong_count(adapter) == 1, - Err(_) => true, - }; - if free { - hub.adapters - .unregister_locked(adapter_id, &mut *adapters_locked); - } + hub.adapters.unregister(adapter_id); } } diff --git a/wgpu-core/src/registry.rs b/wgpu-core/src/registry.rs index 9e1ea5ccd..9183cc83b 100644 --- a/wgpu-core/src/registry.rs +++ b/wgpu-core/src/registry.rs @@ -111,14 +111,6 @@ impl Registry { pub(crate) fn write<'a>(&'a self) -> RwLockWriteGuard<'a, Storage> { self.storage.write() } - pub(crate) fn unregister_locked( - &self, - id: Id, - storage: &mut Storage, - ) -> Option> { - self.identity.free(id); - storage.remove(id) - } pub(crate) fn force_replace_with_error(&self, id: Id) { let mut storage = self.storage.write(); storage.remove(id);