private void endActiveMode() { startPwmButton.Enabled = false; stopPwmButton.Enabled = false; if (connector.Running) { connector.Stop(); } mainControl.deInitialize(); mainControlPanel.Controls.Clear(); mainControl.Dispose(); mainControl = null; this.Text = ApplicationTitle; jitterLabel.Visible = false; jitterCount = 0; GC.Collect(); // Just to make sure }