/// <summary> /// Free resources held by the sink. /// </summary> /// <param name="disposing">If true, called because the object is being disposed; if false, /// the object is being disposed from the finalizer.</param> protected override void Dispose(bool disposing) { // First flush the buffer base.Dispose(disposing); if (disposing) { _statsdUdp.Dispose(); } }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { Flush(); if (!disposedValue) { if (disposing) { statsdUDP?.Dispose(); } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. statsdUDP = null; dog = null; disposedValue = true; } }
public void TearDownUdpListener() { udpListener.Dispose(); udp.Dispose(); }
public void TearDownUdpListener() { _dogStatsdService.Dispose(); _udpListener.Dispose(); _udp.Dispose(); }