We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6575440 commit cb3a84cCopy full SHA for cb3a84c
src/libraries/System.Net.Sockets/tests/FunctionalTests/SocketDuplicationTests.cs
@@ -330,8 +330,16 @@ public async Task DuplicateAndClose_TcpServerHandler(AddressFamily addressFamily
330
else
331
{
332
RemoteInvokeHandle hServerProc = RemoteExecutor.Invoke(HandlerServerCode, _ipcPipeName);
333
- await RunCommonHostLogic(hServerProc.Process.Id);
334
- await hServerProc.DisposeAsync();
+
+ // Since RunCommonHostLogic can throw, we need to make sure the server process is disposed
335
+ try
336
+ {
337
+ await RunCommonHostLogic(hServerProc.Process.Id);
338
+ }
339
+ finally
340
341
+ await hServerProc.DisposeAsync();
342
343
}
344
345
async Task RunCommonHostLogic(int processId)
0 commit comments