Skip to content

Commit acb6b9b

Browse files
authored
Fix QUIC stream handle leak (#56550)
1 parent 58232e0 commit acb6b9b

File tree

1 file changed

+7
-0
lines changed
  • src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic

1 file changed

+7
-0
lines changed

src/libraries/System.Net.Quic/src/System/Net/Quic/Implementations/MsQuic/MsQuicStream.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1334,6 +1334,13 @@ private static uint HandleEventConnectionClose(State state)
13341334
ExceptionDispatchInfo.SetCurrentStackTrace(GetConnectionAbortedException(state)));
13351335
}
13361336

1337+
// Dispose was called before complete event.
1338+
bool releaseHandles = Interlocked.Exchange(ref state.ShutdownDone, 2) == 1;
1339+
if (releaseHandles)
1340+
{
1341+
state.Cleanup();
1342+
}
1343+
13371344
return MsQuicStatusCodes.Success;
13381345
}
13391346

0 commit comments

Comments
 (0)