Fix potential memory leak

This commit is contained in:
Luck 2016-11-24 21:59:48 +00:00
parent cf456cff81
commit a9f29da4f8
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -40,6 +40,7 @@ public class ContextManager<T> {
private final List<ContextListener<T>> listeners = new CopyOnWriteArrayList<>();
private final LoadingCache<T, ContextSet> cache = CacheBuilder.newBuilder()
.weakKeys()
.expireAfterWrite(50L, TimeUnit.MILLISECONDS)
.build(new CacheLoader<T, ContextSet>() {
@Override