public void Dispose() { if (m_Thread != null) { try { m_Pause = false; m_Finished = true; if (m_WaveOut != IntPtr.Zero) { WaveOutBase.waveOutReset(m_WaveOut); } m_Thread.Abort(); //m_Thread.Join(); m_FillProc = null; FreeBuffers(); if (m_WaveOut != IntPtr.Zero) { WaveOutBase.waveOutClose(m_WaveOut); } } finally { m_Thread = null; m_WaveOut = IntPtr.Zero; } } GC.SuppressFinalize(this); }