protected override void OnClosing(CancelEventArgs e) { this.shouldRun = false; this.readerThread.Join(); base.OnClosing(e); }