private void console_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (SIO != null) { SIO.Destroy(); } }
public void Destroy() { lock (this) // we only get in here once { if (!Initialized) { return; } Initialized = false; } if (commPort != null) { commPort.Destroy(); commPort = null; } }