/// <summary> /// Terminates the application's thread if it is running and peforms other cleanup activities. /// </summary> private void Stop() { // Stop the thread. if (appThread != null) { Switch.StopEventLoop(); if (!appThread.Join(MaxThreadStopTime)) { appThread.Abort(); } Switch.Shutdown(); appThread = null; } }