From d365fa63940976ec53c3b94842c3fa6ad45af242 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 24 Jun 2024 06:28:03 -0700 Subject: Fix cache removal (fix #5356) --- src/main/java/org/traccar/session/cache/CacheManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/session/cache/CacheManager.java b/src/main/java/org/traccar/session/cache/CacheManager.java index 064e5672f..f7458567c 100644 --- a/src/main/java/org/traccar/session/cache/CacheManager.java +++ b/src/main/java/org/traccar/session/cache/CacheManager.java @@ -170,7 +170,7 @@ public class CacheManager implements BroadcastInterface { public void removeDevice(long deviceId) { try { lock.writeLock().lock(); - if (deviceReferences.computeIfAbsent(deviceId, k -> new AtomicInteger()).incrementAndGet() <= 0) { + if (deviceReferences.computeIfAbsent(deviceId, k -> new AtomicInteger()).decrementAndGet() <= 0) { graph.removeObject(Device.class, deviceId); devicePositions.remove(deviceId); deviceReferences.remove(deviceId); -- cgit v1.2.3