From b904e2c7592472a2243d9b2e2dbd6651873fe7d9 Mon Sep 17 00:00:00 2001 From: teoxoy <28601907+teoxoy@users.noreply.github.com> Date: Mon, 1 Jul 2024 11:37:51 +0200 Subject: [PATCH] use `Registry.get()` for `device_set_device_lost_closure` --- wgpu-core/src/device/global.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wgpu-core/src/device/global.rs b/wgpu-core/src/device/global.rs index 6016d8c99..31ad1b581 100644 --- a/wgpu-core/src/device/global.rs +++ b/wgpu-core/src/device/global.rs @@ -2388,7 +2388,7 @@ impl Global { ) { let hub = A::hub(self); - if let Ok(Some(device)) = hub.devices.try_get(device_id) { + if let Ok(device) = hub.devices.get(device_id) { let mut life_tracker = device.lock_life(); if let Some(existing_closure) = life_tracker.device_lost_closure.take() { // It's important to not hold the lock while calling the closure.