mirror of
https://github.com/gfx-rs/wgpu.git
synced 2025-04-14 04:56:35 +00:00
Add device_unregister_device_lost_closure
(#6588)
Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
parent
19d80fe229
commit
47bfede63f
@ -2102,6 +2102,14 @@ impl Global {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn device_unregister_device_lost_closure(&self, device_id: DeviceId) {
|
||||
let device = self.hub.devices.get(device_id);
|
||||
let closure = device.device_lost_closure.lock().take();
|
||||
if let Some(closure) = closure {
|
||||
closure.call(DeviceLostReason::ReplacedCallback, "".to_string());
|
||||
}
|
||||
}
|
||||
|
||||
pub fn device_destroy(&self, device_id: DeviceId) {
|
||||
api_log!("Device::destroy {device_id:?}");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user