File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed
src/ApplicationInsights.ServiceFabric.Native/Net45 Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change 20
20
/// Service remoting handler that wraps a service and parses correlation id and context, if they have been passed by the caller as
21
21
/// message headers. This allows traces the client and the service to log traces with the same relevant correlation id and context.
22
22
/// </summary>
23
- public class CorrelatingRemotingMessageHandler : IServiceRemotingMessageHandler
23
+ public class CorrelatingRemotingMessageHandler : IServiceRemotingMessageHandler , IDisposable
24
24
{
25
25
private Lazy < DataContractSerializer > baggageSerializer ;
26
26
@@ -184,5 +184,39 @@ private static string GetOperationId(string id)
184
184
int rootStart = id [ 0 ] == '|' ? 1 : 0 ;
185
185
return id . Substring ( rootStart , rootEnd - rootStart ) ;
186
186
}
187
+
188
+ #region IDisposable Support
189
+ private bool disposedValue = false ; // To detect redundant calls
190
+
191
+ /// <summary>
192
+ /// Overridden by derived class to dispose and clean up resources used by <see cref="CorrelatingRemotingMessageHandler"/>.
193
+ /// </summary>
194
+ /// <param name="disposing">Whether it should dispose managed resources.</param>
195
+ protected virtual void Dispose ( bool disposing )
196
+ {
197
+ if ( ! disposedValue )
198
+ {
199
+ if ( disposing )
200
+ {
201
+ IDisposable disposableHandler = this . innerHandler as IDisposable ;
202
+ if ( disposableHandler != null )
203
+ {
204
+ disposableHandler . Dispose ( ) ;
205
+ }
206
+ }
207
+
208
+ disposedValue = true ;
209
+ }
210
+ }
211
+
212
+ /// <summary>
213
+ /// Dispose and clean up resources used by <see cref="CorrelatingRemotingMessageHandler"/>
214
+ /// </summary>
215
+ public void Dispose ( )
216
+ {
217
+ // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
218
+ Dispose ( true ) ;
219
+ }
220
+ #endregion // IDisposable Support
187
221
}
188
222
}
You can’t perform that action at this time.
0 commit comments