public void Dispose() { if (_tUpdate != null) { _tUpdate.Abort(); } _tUpdate = null; _Follower = null; _ArduinoManager = null; if (_AutomateComm != null) { _AutomateComm.Dispose(); } _AutomateComm = null; }
void Form1_close(object e, FormClosingEventArgs arg) { if (_ThreadSendSensorAsk != null) { _ThreadSendSensorAsk.Abort(); } _AutomateComm.Dispose(); _ArduinoManager = null; //g_Serial.StopListenSerial(); }