From 2cfa76648ad5992703edbaf98272a6cf21bcfc0b Mon Sep 17 00:00:00 2001 From: gents83 Date: Fri, 10 Nov 2023 20:16:06 +0100 Subject: [PATCH] Fixing wrong merge --- wgpu-core/src/device/global.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 2dd292e201..2c01547bb0 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -485,9 +485,9 @@ impl Global { let hub = A::hub(self); log::debug!("Buffer {:?} is asked to be dropped", buffer_id); - let buffer = hub - .buffers - .get(buffer_id) + let mut buffer_guard = hub.buffers.write(); + let buffer = buffer_guard + .take_and_mark_destroyed(buffer_id) .map_err(|_| resource::DestroyError::Invalid)?; buffer.destroy() }