private void FormMain_FormClosing(object sender, FormClosingEventArgs e) { m_mutex.WaitOne(); comPortTreeForm.RemoveAll(); m_mutex.ReleaseMutex(); }