fixed crashing when removing mods

This commit is contained in:
huangyuhui committed 2015-12-29 20:35:40 +08:00
1 parent e3f0254736
commit 3471b4fec7
20 files changed
+152 -243

No files matched your search

@@ -19,10 +19,8 @@ import rx.Observable;
import rx.Observer;
import rx.Scheduler;
import rx.Subscription;
import rx.util.functions.Action0;
import rx.util.functions.Func1;
public class OperationSubscribeOn {
public static <T> Func1<Observer<T>, Subscription> subscribeOn(Observable<T> source, Scheduler scheduler) {
@@ -30,6 +28,7 @@ public class OperationSubscribeOn {
}
private static class SubscribeOn<T> implements Func1<Observer<T>, Subscription> {
private final Observable<T> source;
private final Scheduler scheduler;
@@ -45,6 +44,7 @@ public class OperationSubscribeOn {
}
private static class ScheduledSubscription implements Subscription {
private final Subscription underlying;
private final Scheduler scheduler;
@@ -59,4 +59,4 @@ public class OperationSubscribeOn {
}
}
}
}
@@ -1,12 +1,12 @@
/**
* Copyright 2013 Netflix, Inc.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -19,7 +19,9 @@ import rx.Observer;
import rx.Scheduler;
import rx.util.functions.Action0;
/* package */class ScheduledObserver<T> implements Observer<T> {
/* package */
class ScheduledObserver<T> implements Observer<T> {
private final Observer<T> underlying;
private final Scheduler scheduler;
@@ -30,31 +32,20 @@ import rx.util.functions.Action0;
@Override
public void onCompleted() {
scheduler.schedule(new Action0() {
@Override
public void call() {
underlying.onCompleted();
}
scheduler.schedule(() -> {
underlying.onCompleted();
});
}
@Override
public void onError(final Exception e) {
scheduler.schedule(new Action0() {
@Override
public void call() {
underlying.onError(e);
}
});
scheduler.schedule(() -> underlying.onError(e));
}
@Override
public void onNext(final T args) {
scheduler.schedule(new Action0() {
@Override
public void call() {
underlying.onNext(args);
}
scheduler.schedule(() -> {
underlying.onNext(args);
});
}
}