File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
src/Serilog.Sinks.UDP/Sinks/Splunk Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ namespace Serilog.Sinks.Splunk
2727 /// <summary>
2828 /// A sink that logs to Splunk over UDP
2929 /// </summary>
30- public class UdpSink : IBatchedLogEventSink
30+ public class UdpSink : IBatchedLogEventSink , IDisposable
3131 {
3232 private readonly SplunkUdpSinkConnectionInfo _connectionInfo ;
3333 private readonly ITextFormatter _formatter ;
@@ -77,9 +77,19 @@ private void Connect()
7777 /// Releases resources used by the sink.
7878 /// </summary>
7979 /// <param name="disposing">True if called from Dispose, false if called from a finalizer.</param>
80- protected void Dispose ( bool disposing )
80+ protected virtual void Dispose ( bool disposing )
8181 {
82- DisposeSocket ( ) ;
82+ if ( disposing )
83+ {
84+ DisposeSocket ( ) ;
85+ }
86+ }
87+
88+ /// <inheritdoc/>
89+ public void Dispose ( )
90+ {
91+ Dispose ( true ) ;
92+ GC . SuppressFinalize ( this ) ;
8393 }
8494
8595 private void DisposeSocket ( )
You can’t perform that action at this time.
0 commit comments