public void Dispose() { if (m_Thread != null) { try { m_Finished = true; if (m_WaveOut != IntPtr.Zero) { WaveNative.waveOutReset(m_WaveOut); } m_Thread.Join(); m_FillProc = null; FreeBuffers(); if (m_WaveOut != IntPtr.Zero) { WaveNative.waveOutClose(m_WaveOut); } } finally { m_Thread = null; m_WaveOut = IntPtr.Zero; } } GC.SuppressFinalize(this); }
public void Dispose() { if (this.m_Thread == null) { return; } try { this.m_Finished = true; if (this.m_WaveOut != IntPtr.Zero) { WaveNative.waveOutReset(this.m_WaveOut); } this.m_Thread.Join(); this.m_FillProc = (BufferFillEventHandler)null; this.FreeBuffers(); if (this.m_WaveOut != IntPtr.Zero) { WaveNative.waveOutClose(this.m_WaveOut); } } finally { this.m_Thread = (Thread)null; this.m_WaveOut = IntPtr.Zero; } }