diff options
Diffstat (limited to 'main/src/cgeo/geocaching/maps/CGeoMap.java')
| -rw-r--r-- | main/src/cgeo/geocaching/maps/CGeoMap.java | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java index 28e1b71..41f622f 100644 --- a/main/src/cgeo/geocaching/maps/CGeoMap.java +++ b/main/src/cgeo/geocaching/maps/CGeoMap.java @@ -517,13 +517,8 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto @Override public void onPause() { - if (loadTimer != null) { - loadTimer.stopIt(); - loadTimer = null; - } - + stopTimer(); deleteGeoDirObservers(); - savePrefs(); if (mapView != null) { @@ -994,15 +989,19 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto (new DisplayPointThread()).start(); } else { // start timer - if (loadTimer != null) { - loadTimer.stopIt(); - loadTimer = null; - } + stopTimer(); loadTimer = new LoadTimer(); loadTimer.start(); } } + private synchronized void stopTimer() { + if (loadTimer != null) { + loadTimer.stopIt(); + loadTimer = null; + } + } + /** * loading timer Triggers every 250ms and checks for viewport change and starts a {@link LoadRunnable}. */ |
