Properly shutdown the AudioUnit on drop
This commit is contained in:
parent
f212d85889
commit
d6470de74c
|
@ -72,6 +72,15 @@ impl Voice {
|
|||
}
|
||||
}
|
||||
|
||||
impl Drop for Voice {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
check_errors(au::AudioOutputUnitStop(*self.audio_unit)).unwrap();
|
||||
check_errors(au::AudioUnitUninitialize(*self.audio_unit)).unwrap();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, T> Buffer<'a, T> {
|
||||
pub fn get_buffer<'b>(&'b mut self) -> &'b mut [T] {
|
||||
&mut self.samples[..]
|
||||
|
|
Loading…
Reference in New Issue