Skip to content

Commit 3dbee78

Browse files
committed
Fix memory 'leak' (fix #240)
1 parent 560c930 commit 3dbee78

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
import org.openstreetmap.josm.plugins.mapillary.utils.MapillarySequenceUtils;
7171
import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils;
7272
import org.openstreetmap.josm.plugins.mapillary.utils.OffsetUtils;
73+
import org.openstreetmap.josm.spi.preferences.Config;
7374
import org.openstreetmap.josm.tools.ExifReader;
7475
import org.openstreetmap.josm.tools.JosmRuntimeException;
7576
import org.openstreetmap.josm.tools.Logging;
@@ -83,8 +84,8 @@
8384
*/
8485
public class MapillaryImageEntry
8586
implements IImageEntry<MapillaryImageEntry>, BiConsumer<Long, Collection<ImageDetection<?>>> {
86-
private static final CacheAccess<Long, MapillaryImageEntry> CACHE = JCSCacheManager
87-
.getCache("mapillary:mapillaryimageentry");
87+
private static final CacheAccess<Long, MapillaryImageEntry> CACHE =
88+
JCSCacheManager.getCache("mapillary:mapillaryimageentry", Config.getPref().getInt("mapillary.jcs.cache.max_objects_in_memory", 10), 0, null);
8889
private static final String MESSAGE_SEPARATOR = " — ";
8990
private INode image;
9091
private final List<ImageDetection<?>> imageDetections = new ArrayList<>();

0 commit comments

Comments
 (0)