From aca1fa0674950a0ed0cfaf4ed1103f08c0f794ba Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 4 Aug 2015 00:25:11 +0200 Subject: [PATCH] Fix disabling map --- OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index 2ee385403c..1b98d1d245 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -143,14 +143,14 @@ public class MapRenderRepositories { return prevBmpLocation; } - public void closeConnection(String file) { + public synchronized void closeConnection(String file) { LinkedHashMap cpfiles = new LinkedHashMap(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); } }