private void Form2_FormClosing(object sender, FormClosingEventArgs e) { //if (xx != null) // { // xx.Dispose(); // xx = null; // } aa = null; //if (pp != null) // { // pp.Close(); // pp = null; // } //if (ss != null) // { // ss.Close(); // ss = null; // } //if (cc != null) // { // cc.Close(); // cc = null; // } FC.Dispose(); XML.Dispose(); TheadTest = null; }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { if (excl != null) { excl.Dispose(); } excl = null; if (mmm != null) { mmm.Dispose(); } mmm = null; if (RSPort != null) { RSPort.ClosePort(); } RSPort = null; bb = null; cc = null; if (xxxx != null) { xxxx.Close(); } xxxx = null; if (ww != null) { ww.Dispose(); } ww = null; if (Test != null) { Test.Close(); } Test = null; ReadData = null; //ll.Close(); }