File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
rxjava-core/src/main/java/rx/operators Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ public void call() {
62
62
}
63
63
}));
64
64
try {
65
+ //don't block or propagate CancellationException if already unsubscribed
66
+ if (subscriber .isUnsubscribed ()) {
67
+ return ;
68
+ }
65
69
T value = (unit == null ) ? (T ) that .get () : (T ) that .get (time , unit );
66
70
subscriber .onNext (value );
67
71
subscriber .onCompleted ();
@@ -71,6 +75,10 @@ public void call() {
71
75
// since it's already subscribed.
72
76
// If the Future is canceled in other place, CancellationException will be still
73
77
// passed to the final Subscriber.
78
+ if (subscriber .isUnsubscribed ()) {
79
+ //refuse to emit onError if already unsubscribed
80
+ return ;
81
+ }
74
82
subscriber .onError (e );
75
83
}
76
84
}
You can’t perform that action at this time.
0 commit comments