/// <summary> /// Dispose. /// </summary> /// <param name="disposing"> /// If disposing equals true, the method has been called directly /// or indirectly by a user's code. Managed and unmanaged resources /// can be disposed. /// If disposing equals false, the method has been called by the /// runtime from inside the finalizer and you should not reference /// other objects. Only unmanaged resources can be disposed. /// </param> private void Dispose(bool disposing) { // Check to see if Dispose has already been called. if (!m_disposed) { // If disposing equals true, dispose all managed // and unmanaged resources. if (disposing) { // clean up managed resources if (m_working) { CancelScan(); } m_sniffer.StopListening(); // dispose of timers m_timeoutTimer.Dispose(); if (m_sendTimer != null) { m_sendTimer.Dispose(); } } // clean up unmanaged resources } m_disposed = true; }
/// <summary> /// Dispose of this class. /// </summary> public void Dispose() { if (m_working) { CancelTrace(); } m_sniffer.StopListening(); m_timer.Dispose(); m_disposed = true; }
/// <summary> /// Dispose of this class. /// </summary> public void Dispose() { m_sniffer.StopListening(); m_timer.Dispose(); m_disposed = true; }