Fix disabling map

This commit is contained in:
Victor Shcherb 2015-08-04 00:25:11 +02:00
parent 81d026aa25
commit aca1fa0674

View file

@ -143,14 +143,14 @@ public class MapRenderRepositories {
return prevBmpLocation;
}
public void closeConnection(String file) {
public synchronized void closeConnection(String file) {
LinkedHashMap<String, BinaryMapIndexReader> cpfiles = new LinkedHashMap<String, BinaryMapIndexReader>(files);
BinaryMapIndexReader bmir = cpfiles.remove(file);
files = cpfiles;
if (nativeFiles.contains(file)) {
NativeOsmandLibrary lib = NativeOsmandLibrary.getLoadedLibrary();
if (lib != null) {
lib.closeMapFile(file);
lib.closeMapFile(bmir != null ? bmir.getFile().getAbsolutePath() : file);
nativeFiles.remove(file);
}
}