/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected override void Dispose(bool disposing) { if (!disposing) { return; } _queue.Dispose(); _messageMethodHandling.Dispose(); base.Dispose(true); }
private bool _disposedValue; // To detect redundant calls /// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param> protected virtual void Dispose(bool disposing) { if (!_disposedValue) { if (disposing) { _queue.Dispose(); _messageMethodHandling.Dispose(); } _disposedValue = true; } }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { _handler.Dispose(); }