Unified · Split
| @@ -644,7 +644,16 @@ namespace GSF.ServiceProcess · 643 unmodified lines | |||
| 644 | // This will be done only when the object is disposed by calling Dispose(). | 644 | // This will be done only when the object is disposed by calling Dispose(). |
| 645 | Disconnect(); | 645 | Disconnect(); |
| 646 | SaveSettings(); | 646 | SaveSettings(); |
| 647 | RemotingClient = null; | 647 | |
| 648 | if ((object)m_remotingClient != null) | ||
| 649 | { | ||
| 650 | // Detach events from any existing instance | ||
| 651 | m_remotingClient.ConnectionEstablished -= RemotingClient_ConnectionEstablished; | ||
| 652 | m_remotingClient.ConnectionAttempt -= RemotingClient_ConnectionAttempt; | ||
| 653 | m_remotingClient.ConnectionException -= RemotingClient_ConnectionException; | ||
| 654 | m_remotingClient.ConnectionTerminated -= RemotingClient_ConnectionTerminated; | ||
| 655 | m_remotingClient.ReceiveDataComplete -= RemotingClient_ReceiveDataComplete; | ||
| 656 | } | ||
| 648 | } | 657 | } |
| 649 | } | 658 | } |
| 650 | finally | 659 | finally |