Add destructor for wasapi::Channel
This commit is contained in:
parent
99c23327d8
commit
8efaf06ec2
|
@ -90,6 +90,22 @@ impl Channel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Drop for Channel {
|
||||||
|
fn drop(&mut self) {
|
||||||
|
unsafe {
|
||||||
|
{
|
||||||
|
let f = self.render_client.as_mut().unwrap().lpVtbl.as_ref().unwrap().Release;
|
||||||
|
f(self.render_client);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
let f = self.audio_client.as_mut().unwrap().lpVtbl.as_ref().unwrap().Release;
|
||||||
|
f(self.audio_client);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<'a> Buffer<'a> {
|
impl<'a> Buffer<'a> {
|
||||||
pub fn get_buffer(&mut self) -> &mut [u8] {
|
pub fn get_buffer(&mut self) -> &mut [u8] {
|
||||||
self.buffer.as_mut_slice()
|
self.buffer.as_mut_slice()
|
||||||
|
|
Loading…
Reference in New Issue