Don't leak memory in the speex resampler wrapper if something goes bad
This commit is contained in:
parent
871c16028a
commit
010fb01bf8
|
@ -399,9 +399,18 @@ namespace BizHawk.Emulation.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
|
{
|
||||||
|
if (st != IntPtr.Zero)
|
||||||
{
|
{
|
||||||
LibSpeexDSP.speex_resampler_destroy(st);
|
LibSpeexDSP.speex_resampler_destroy(st);
|
||||||
st = IntPtr.Zero;
|
st = IntPtr.Zero;
|
||||||
|
GC.SuppressFinalize(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
~SpeexResampler()
|
||||||
|
{
|
||||||
|
Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
void InternalDrain(short[] buf, int nsamp)
|
void InternalDrain(short[] buf, int nsamp)
|
||||||
|
|
Loading…
Reference in New Issue