PerCVoice.OnDisable C# (CSharp) Method

OnDisable() private method

private OnDisable ( ) : void
return void
    void OnDisable()
    {
        //shut down the thread
        if(myThread!=null){
            keepLooping = false;
            Thread.Sleep(5);
            myThread.Join();
            myThread = null;
        }

        //shut down the pipeline
        if(myPipe != null){
            myPipe.Dispose();
            myPipe = null;
        }
    }