Skip to content

Commit 24b992f

Browse files
authored
Ignore dispose error (#5105)
1 parent bfdaf0b commit 24b992f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/Microsoft.TestPlatform.CommunicationUtilities/SocketClient.cs

+9-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,15 @@ public void Stop()
7070
if (!_stopped)
7171
{
7272
EqtTrace.Info("SocketClient: Stop: Cancellation requested. Stopping message loop.");
73-
_cancellation.Cancel();
73+
74+
try
75+
{
76+
_cancellation.Cancel();
77+
}
78+
catch (ObjectDisposedException)
79+
{
80+
// This is race condition with stop on error.
81+
}
7482
}
7583
}
7684

0 commit comments

Comments
 (0)