WYZTracker.Core/Player/PlaybackStreamer.cs
/// <summary>
/// Dispose. Release worker thread, semaphore and audio context.
/// </summary>
/// <param name="disposing">Indicates if the user called the dispose method or the finalizer did it.</param>
Dispose. Release worker thread, semaphore and audio context.
Dispose . Release worker thread semaphore and audio context .
protected virtual void Dispose(bool disposing)
        {
            if (_threadActive)
            {
                _threadActive = false;
                _workerThread.Join(2000);
                _workerThread = null;
            }
            if (disposing)
            {
                if (_audioSource != 0)
                {
                    AL.SourceStop(_audioSource);
                    AL.DeleteSource(_audioSource);
                    _audioSource = 0;
                }
                if (_buffers != null)
                {
                    AL.DeleteBuffers(_buffers);
                    _buffers = null;
                }
            }
        }
protected virtual void Dispose ( bool disposing ) { if ( _threadActive ) { _threadActive = false ; _workerThread . Join ( 2000 ) ; _workerThread = null ; } if ( disposing ) { if ( _audioSource != 0 ) { AL . SourceStop ( _audioSource ) ; AL . DeleteSource ( _audioSource ) ; _audioSource = 0 ; } if ( _buffers != null ) { AL . DeleteBuffers ( _buffers ) ; _buffers = null ; } } }
Dispose.
Dispose .
// Release the worker thread and semaphore if needed. //Console.WriteLine("AL.SourceStop: {0}", AL.GetErrorString(AL.GetError())); //Console.WriteLine("AL.DeleteSource: {0}", AL.GetErrorString(AL.GetError())); //Console.WriteLine("AL.DeleteBuffers: {0}", AL.GetErrorString(AL.GetError()));
disposing
bool
Indicates if the user called the dispose method or the finalizer did it.
Indicates if the user called the dispose method or the finalizer did it .