Skip to content

Commit

Permalink
Fix multiple subscription bug on operation filter
Browse files Browse the repository at this point in the history
A new subscription must be created on every subscribe call, otherwise any
subscribe call after the first directly fails.
  • Loading branch information
Treora committed May 1, 2013
1 parent 69e0d99 commit 0a379df
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ private static class Filter<T> implements Func1<Observer<T>, Subscription> {

private final Observable<T> that;
private final Func1<T, Boolean> predicate;
private final AtomicObservableSubscription subscription = new AtomicObservableSubscription();

public Filter(Observable<T> that, Func1<T, Boolean> predicate) {
this.that = that;
this.predicate = predicate;
}

public Subscription call(final Observer<T> observer) {
final AtomicObservableSubscription subscription = new AtomicObservableSubscription();
return subscription.wrap(that.subscribe(new Observer<T>() {
public void onNext(T value) {
try {
Expand Down

0 comments on commit 0a379df

Please sign in to comment.