/// <summary> /// Disposes the logger instance and flushes any non-written /// log entries from the internal queue. /// </summary> /// <param name="bIsDisposing"></param> public void Dispose(bool bIsDisposing) { Debug.WriteLine("Dispose(bool) called.", "Logger.Dispose(bool)"); if (!m_bDisposed) { if (bIsDisposing) { //clean up managed resources m_oTimer.Dispose(); m_oTimer = null; m_oTimerCallback = null; m_oFlushDelegate = null; } //clean up potentially un-managed resources //and write events to handlers if queue is not empty if (m_qEvents != null) { WriteToHandler(); } } m_bDisposed = true; }
/// <summary> /// Disposes the logger instance and flushes any non-written /// log entries from the internal queue. /// </summary> /// <param name="bIsDisposing"></param> public void Dispose(bool bIsDisposing) { Debug.WriteLine("Dispose(bool) called.", "Logger.Dispose(bool)"); if (!m_bDisposed) { if (bIsDisposing) { //clean up managed resources m_oTimer.Dispose(); m_oTimer = null; m_oTimerCallback = null; m_oFlushDelegate = null; } //clean up potentially un-managed resources //and write events to handlers if queue is not empty if (m_qEvents != null) { WriteToHandler(); } } m_bDisposed = true; }