Skip to content

Commit 4b53474

Browse files
Merge pull request ReactiveX#1355 from akarnokd/ReplaySubjectDontAddUnsubscribedChild
Don't add the subscriber to the manager if it unsubscribed during the on...
2 parents 4f32c82 + 792c4ed commit 4b53474

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rxjava-core/src/main/java/rx/subjects/SubjectSubscriptionManager.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,10 @@ public void call(final Subscriber<? super T> child) {
5757
SubjectObserver<T> bo = new SubjectObserver<T>(child);
5858
addUnsubscriber(child, bo);
5959
onStart.call(bo);
60-
if (add(bo) && child.isUnsubscribed()) {
61-
remove(bo);
60+
if (!child.isUnsubscribed()) {
61+
if (add(bo) && child.isUnsubscribed()) {
62+
remove(bo);
63+
}
6264
}
6365
}
6466
/** Registers the unsubscribe action for the given subscriber. */

0 commit comments

Comments
 (0)