Don't dispose on cancellation (#1859)

- We're already disposing now at the end of enumeration
This commit is contained in:
David Fowler 2018-04-05 09:22:46 -07:00 committed by GitHub
parent 61c3d0c403
commit 35b6d81f77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 0 additions and 3 deletions

View File

@ -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);
}