mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
fix(native): properly cleanup resource when activating device failed (#11380)
This commit is contained in:
@@ -225,6 +225,8 @@ impl AggregateDevice {
|
||||
// Start the device to activate it
|
||||
let status = unsafe { AudioDeviceStart(device_id, dummy_proc_id) };
|
||||
if status != 0 {
|
||||
// Clean up the IO proc if AudioDeviceStart fails
|
||||
let _ = unsafe { AudioDeviceDestroyIOProcID(device_id, dummy_proc_id) };
|
||||
return Err(CoreAudioError::AudioDeviceStartFailed(status).into());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user