Skip to content

Commit b7af5c9

Browse files
committed
Add unsubscribe
1 parent dda2351 commit b7af5c9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rxjava-core/src/main/java/rx/operators/OperatorTakeWhile.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,14 @@ public void onNext(T args) {
5656
isSelected = predicate.call(args, counter++);
5757
} catch (Throwable e) {
5858
subscriber.onError(e);
59+
unsubscribe();
5960
return;
6061
}
6162
if (isSelected) {
6263
subscriber.onNext(args);
6364
} else {
6465
subscriber.onCompleted();
66+
unsubscribe();
6567
}
6668
}
6769

0 commit comments

Comments
 (0)