File tree Expand file tree Collapse file tree 2 files changed +14
-7
lines changed
src/System.Reactive/Linq/Observable
tests/Tests.System.Reactive/Tests/Linq/Observable Expand file tree Collapse file tree 2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -524,7 +524,10 @@ public override void OnError(Exception error)
524524
525525 public override void OnCompleted ( )
526526 {
527- Dispose ( ) ;
527+ // Calling Dispose() here would clear the queue prematurely.
528+ // We only need to dispose the IDisposable of the upstream,
529+ // which is done by SafeObserver.Dispose(bool).
530+ base . Dispose ( true ) ;
528531
529532 lock ( _gate )
530533 {
Original file line number Diff line number Diff line change @@ -4462,13 +4462,17 @@ public void Zip2WithImmediateReturn()
44624462 [ Fact ]
44634463 public void Zip3WithImmediateReturn ( )
44644464 {
4465- Observable . Zip < Unit , Unit , Unit , Unit > (
4466- Observable . Return ( Unit . Default ) ,
4467- Observable . Return ( Unit . Default ) ,
4468- Observable . Return ( Unit . Default ) ,
4469- ( _ , __ , ___ ) => Unit . Default
4465+ int result = 0 ;
4466+
4467+ Observable . Zip < int , int , int , int > (
4468+ Observable . Return ( 1 ) ,
4469+ Observable . Return ( 2 ) ,
4470+ Observable . Return ( 4 ) ,
4471+ ( a , b , c ) => a + b + c
44704472 )
4471- . Subscribe ( _ => { } ) ;
4473+ . Subscribe ( v => result = v ) ;
4474+
4475+ Assert . Equal ( 7 , result ) ;
44724476 }
44734477
44744478 [ Fact ]
You can’t perform that action at this time.
0 commit comments