Don't dispose on cancellation (#1859)
- We're already disposing now at the end of enumeration
This commit is contained in:
parent
61c3d0c403
commit
35b6d81f77
|
|
@ -18,9 +18,6 @@ namespace Microsoft.AspNetCore.SignalR.Internal
|
|||
|
||||
var subscription = observable.Subscribe(new ChannelObserver<T>(channel.Writer, cancellationToken));
|
||||
|
||||
// Dispose the subscription when the token is cancelled
|
||||
cancellationToken.Register(state => ((IDisposable)state).Dispose(), subscription);
|
||||
|
||||
// Make sure the subscription is disposed when enumeration is completed.
|
||||
return new AsyncEnumerator<object>(channel.Reader, cancellationToken, subscription);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue