Fix disabling map
This commit is contained in:
parent
81d026aa25
commit
aca1fa0674
1 changed files with 2 additions and 2 deletions
|
@ -143,14 +143,14 @@ public class MapRenderRepositories {
|
||||||
return prevBmpLocation;
|
return prevBmpLocation;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void closeConnection(String file) {
|
public synchronized void closeConnection(String file) {
|
||||||
LinkedHashMap<String, BinaryMapIndexReader> cpfiles = new LinkedHashMap<String, BinaryMapIndexReader>(files);
|
LinkedHashMap<String, BinaryMapIndexReader> cpfiles = new LinkedHashMap<String, BinaryMapIndexReader>(files);
|
||||||
BinaryMapIndexReader bmir = cpfiles.remove(file);
|
BinaryMapIndexReader bmir = cpfiles.remove(file);
|
||||||
files = cpfiles;
|
files = cpfiles;
|
||||||
if (nativeFiles.contains(file)) {
|
if (nativeFiles.contains(file)) {
|
||||||
NativeOsmandLibrary lib = NativeOsmandLibrary.getLoadedLibrary();
|
NativeOsmandLibrary lib = NativeOsmandLibrary.getLoadedLibrary();
|
||||||
if (lib != null) {
|
if (lib != null) {
|
||||||
lib.closeMapFile(file);
|
lib.closeMapFile(bmir != null ? bmir.getFile().getAbsolutePath() : file);
|
||||||
nativeFiles.remove(file);
|
nativeFiles.remove(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue