aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main/src/cgeo/geocaching/DataStore.java2
-rw-r--r--main/src/cgeo/geocaching/maps/CGeoMap.java5
-rw-r--r--main/src/cgeo/geocaching/settings/Settings.java2
3 files changed, 3 insertions, 6 deletions
diff --git a/main/src/cgeo/geocaching/DataStore.java b/main/src/cgeo/geocaching/DataStore.java
index 9075d45..c6ee9f2 100644
--- a/main/src/cgeo/geocaching/DataStore.java
+++ b/main/src/cgeo/geocaching/DataStore.java
@@ -304,7 +304,7 @@ public class DataStore {
}
}
- public static void closeDb() {
+ public static synchronized void closeDb() {
if (database == null) {
return;
}
diff --git a/main/src/cgeo/geocaching/maps/CGeoMap.java b/main/src/cgeo/geocaching/maps/CGeoMap.java
index 927ff28..d8cad51 100644
--- a/main/src/cgeo/geocaching/maps/CGeoMap.java
+++ b/main/src/cgeo/geocaching/maps/CGeoMap.java
@@ -186,7 +186,7 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
private boolean markersInvalidated = false; // previous state for loadTimer
private boolean centered = false; // if map is already centered
private boolean alreadyCentered = false; // -""- for setting my location
- private static Set<String> dirtyCaches = null;
+ private static final Set<String> dirtyCaches = new HashSet<String>();
// Thread pooling
private static BlockingQueue<Runnable> displayQueue = new ArrayBlockingQueue<Runnable>(1);
@@ -1605,9 +1605,6 @@ public class CGeoMap extends AbstractMap implements OnMapDragListener, ViewFacto
}
public static void markCacheAsDirty(final String geocode) {
- if (dirtyCaches == null) {
- dirtyCaches = new HashSet<String>();
- }
dirtyCaches.add(geocode);
}
diff --git a/main/src/cgeo/geocaching/settings/Settings.java b/main/src/cgeo/geocaching/settings/Settings.java
index 186e5d9..0732866 100644
--- a/main/src/cgeo/geocaching/settings/Settings.java
+++ b/main/src/cgeo/geocaching/settings/Settings.java
@@ -599,7 +599,7 @@ public class Settings {
putInt(R.string.pref_lastmaplon, mapViewCenter.getLongitudeE6());
}
- public static MapSource getMapSource() {
+ public static synchronized MapSource getMapSource() {
if (mapSource != null) {
return mapSource;
}