aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/sensors
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2014-12-01 00:20:36 +0100
committerSamuel Tardieu <sam@rfc1149.net>2014-12-01 00:21:35 +0100
commit1eb33c7763f210319f732293a8f7e34ac58d8cc9 (patch)
tree215f1560eef497dc90d79f7126ae6d1c50753caa /main/src/cgeo/geocaching/sensors
parent2021f9d2415ffa90af65d5bf6d378b4387b8aa0c (diff)
downloadcgeo-1eb33c7763f210319f732293a8f7e34ac58d8cc9.zip
cgeo-1eb33c7763f210319f732293a8f7e34ac58d8cc9.tar.gz
cgeo-1eb33c7763f210319f732293a8f7e34ac58d8cc9.tar.bz2
fix #4505: sporadic crash when trying to navigate to a waypoint
Diffstat (limited to 'main/src/cgeo/geocaching/sensors')
-rw-r--r--main/src/cgeo/geocaching/sensors/GeoDirHandler.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java
index 69297af..d043a4a 100644
--- a/main/src/cgeo/geocaching/sensors/GeoDirHandler.java
+++ b/main/src/cgeo/geocaching/sensors/GeoDirHandler.java
@@ -125,12 +125,13 @@ public abstract class GeoDirHandler {
}));
}
if ((flags & UPDATE_GEODIR) != 0) {
+ // combineOnLatest() does not implement backpressure handling, so we need to explicitely use a backpressure operator there.
subscriptions.add(throttleIfNeeded(Observable.combineLatest(app.geoDataObservable(lowPower), app.directionObservable(), new Func2<GeoData, Float, ImmutablePair<GeoData, Float>>() {
@Override
public ImmutablePair<GeoData, Float> call(final GeoData geoData, final Float direction) {
return ImmutablePair.of(geoData, fixDirection(geoData, direction));
}
- }), windowDuration, unit).observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<ImmutablePair<GeoData, Float>>() {
+ }), windowDuration, unit).onBackpressureDrop().observeOn(AndroidSchedulers.mainThread()).subscribe(new Action1<ImmutablePair<GeoData, Float>>() {
@Override
public void call(final ImmutablePair<GeoData, Float> geoDir) {
updateGeoDir(geoDir.left, geoDir.right);