Skip to content

Commit d7101a3

Browse files
Fix #57232 potential CancellationTokenSource leak in HubConnection (#58303)
1 parent 44a9f8a commit d7101a3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/SignalR/clients/csharp/Client.Core/src/HubConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ private async Task ReceiveLoop(ConnectionState connectionState)
15961596
var timer = new TimerAwaitable(TickRate, TickRate);
15971597
var timerTask = connectionState.TimerLoop(timer);
15981598

1599-
var uploadStreamSource = new CancellationTokenSource();
1599+
using var uploadStreamSource = new CancellationTokenSource();
16001600
connectionState.UploadStreamToken = uploadStreamSource.Token;
16011601
var invocationMessageChannel = Channel.CreateUnbounded<InvocationMessage>(_receiveLoopOptions);
16021602

0 commit comments

Comments
 (0)