protected virtual void Terminate() { try { //if (ControlCEC != null) //ControlCEC = null; if (ControlIR != null) { ControlIR.UnRegister(); } if (ControlRelay != null) { ControlRelay.UnRegister(); } if (ControlSerial != null) { ControlSerial.UnRegister(); } if (ControlTCP != null) { ControlTCP.Dispose(); } if (ControlUDP != null) { ControlUDP.Dispose(); } if (ControlVP != null) { ControlVP.UnRegister(); } } catch (Exception e) { ErrorLog.Exception("Exception terminating " + this.Name, e); } }