Add device_unregister_device_lost_closure (#6588)

Co-authored-by: Erich Gubler <erichdongubler@gmail.com>
This commit is contained in:
Teodor Tanasoaia 2024-11-22 20:49:47 +01:00 committed by GitHub
parent 19d80fe229
commit 47bfede63f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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:?}");