Skip to content

Commit

Permalink
Add device_unregister_device_lost_closure (gfx-rs#6588)
Browse files Browse the repository at this point in the history
Co-authored-by: Erich Gubler <[email protected]>
  • Loading branch information
teoxoy and ErichDonGubler authored Nov 22, 2024
1 parent 19d80fe commit 47bfede
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions wgpu-core/src/device/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}");

Expand Down

0 comments on commit 47bfede

Please sign in to comment.