Browse Source

Clear the enumerator in OnNext

akarnokd 6 years ago
parent
commit
87aa2b0a15
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Zip.cs

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Zip.cs

@@ -353,7 +353,7 @@ namespace System.Reactive.Linq.ObservableImpl
                         {
                             if (Interlocked.Decrement(ref _enumerationInProgress) != 0)
                             {
-                                currentEnumerator.Dispose();
+                                Interlocked.Exchange(ref _rightEnumerator, DisposedEnumerator)?.Dispose();
                                 wasDisposed = true;
                             }
                         }