File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -124,10 +124,12 @@ private void CloseSocket()
124
124
125
125
lock ( _socketLock )
126
126
{
127
+ #pragma warning disable CA1508 // Avoid dead conditional code
127
128
if ( _socket is null )
128
129
{
129
130
return ;
130
131
}
132
+ #pragma warning restore CA1508 // Avoid dead conditional code
131
133
132
134
// closing a socket actually disposes the socket, so we can safely dereference
133
135
// the field to avoid entering the lock again later
@@ -293,11 +295,13 @@ protected override void Dispose(bool disposing)
293
295
lock ( _socketLock )
294
296
{
295
297
var socket = _socket ;
298
+ #pragma warning disable CA1508 // Avoid dead conditional code
296
299
if ( socket != null )
297
300
{
298
301
_socket = null ;
299
302
socket . Dispose ( ) ;
300
303
}
304
+ #pragma warning restore CA1508 // Avoid dead conditional code
301
305
}
302
306
}
303
307
Original file line number Diff line number Diff line change @@ -164,11 +164,13 @@ private void CloseSocket()
164
164
lock ( _socketShutdownAndCloseLock )
165
165
{
166
166
var socket = _socket ;
167
+ #pragma warning disable CA1508 // Avoid dead conditional code
167
168
if ( socket != null )
168
169
{
169
170
_socket = null ;
170
171
socket . Dispose ( ) ;
171
172
}
173
+ #pragma warning restore CA1508 // Avoid dead conditional code
172
174
}
173
175
}
174
176
Original file line number Diff line number Diff line change @@ -1161,6 +1161,7 @@ protected override void Dispose(bool disposing)
1161
1161
{
1162
1162
lock ( _lock )
1163
1163
{
1164
+ #pragma warning disable CA1508 // Avoid dead conditional code
1164
1165
if ( _session != null )
1165
1166
{
1166
1167
_canRead = false ;
@@ -1184,6 +1185,7 @@ protected override void Dispose(bool disposing)
1184
1185
1185
1186
_session = null ;
1186
1187
}
1188
+ #pragma warning restore CA1508 // Avoid dead conditional code
1187
1189
}
1188
1190
}
1189
1191
}
You can’t perform that action at this time.
0 commit comments