Skip to content

Commit

Permalink
Add unsubscribe
Browse files Browse the repository at this point in the history
  • Loading branch information
zsxwing committed Apr 29, 2014
1 parent dda2351 commit b7af5c9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rxjava-core/src/main/java/rx/operators/OperatorTakeWhile.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@ public void onNext(T args) {
isSelected = predicate.call(args, counter++);
} catch (Throwable e) {
subscriber.onError(e);
unsubscribe();
return;
}
if (isSelected) {
subscriber.onNext(args);
} else {
subscriber.onCompleted();
unsubscribe();
}
}

Expand Down

0 comments on commit b7af5c9

Please sign in to comment.