From 5992090cbd57318f8c30ca6027e056d943693701 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 5 Mar 2019 19:26:05 +0100 Subject: [PATCH] Add synchronized to avoid crashes --- .../net/osmand/plus/resources/IncrementalChangesManager.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java index 85ee219a99..c9de4ae387 100644 --- a/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/IncrementalChangesManager.java @@ -64,7 +64,7 @@ public class IncrementalChangesManager { return files; } - public void indexMainMap(File f, long dateCreated) { + public synchronized void indexMainMap(File f, long dateCreated) { String nm = Algorithms.getFileNameWithoutExtension(f).toLowerCase(); RegionUpdateFiles regionUpdateFiles = regions.get(nm); if(regionUpdateFiles == null) { @@ -111,7 +111,7 @@ public class IncrementalChangesManager { } } - public boolean index(File f, long dateCreated, BinaryMapIndexReader mapReader) { + public synchronized boolean index(File f, long dateCreated, BinaryMapIndexReader mapReader) { String index = Algorithms.getFileNameWithoutExtension(f).toLowerCase(); if(index.length() <= 9 || index.charAt(index.length() - 9) != '_'){ return false;