From 35b6d81f7744da672861dd2e72c0130c79dd82c4 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Thu, 5 Apr 2018 09:22:46 -0700 Subject: [PATCH] Don't dispose on cancellation (#1859) - We're already disposing now at the end of enumeration --- .../Internal/AsyncEnumeratorAdapters.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/Microsoft.AspNetCore.SignalR.Core/Internal/AsyncEnumeratorAdapters.cs b/src/Microsoft.AspNetCore.SignalR.Core/Internal/AsyncEnumeratorAdapters.cs index a04eafba56..adcb911639 100644 --- a/src/Microsoft.AspNetCore.SignalR.Core/Internal/AsyncEnumeratorAdapters.cs +++ b/src/Microsoft.AspNetCore.SignalR.Core/Internal/AsyncEnumeratorAdapters.cs @@ -18,9 +18,6 @@ namespace Microsoft.AspNetCore.SignalR.Internal var subscription = observable.Subscribe(new ChannelObserver(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(channel.Reader, cancellationToken, subscription); }