Merge pull request #742 from AmionSky/fix-memfree
Fix CoTaskMemFree always getting called with null
This commit is contained in:
commit
c67b4288f5
1 changed files with 2 additions and 2 deletions
|
|
@ -134,7 +134,7 @@ struct WaveFormatExPtr(*mut Audio::WAVEFORMATEX);
|
||||||
impl Drop for WaveFormatExPtr {
|
impl Drop for WaveFormatExPtr {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe {
|
unsafe {
|
||||||
Com::CoTaskMemFree(None);
|
Com::CoTaskMemFree(Some(self.0 as *mut _));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -823,7 +823,7 @@ impl PartialEq for Device {
|
||||||
/// RAII for device IDs.
|
/// RAII for device IDs.
|
||||||
impl Drop for IdRAII {
|
impl Drop for IdRAII {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
unsafe { Com::CoTaskMemFree(None) }
|
unsafe { Com::CoTaskMemFree(Some(self.0 .0 as *mut _)) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// GetId only fails with E_OUTOFMEMORY and if it does, we're probably dead already.
|
// GetId only fails with E_OUTOFMEMORY and if it does, we're probably dead already.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue