switch to WeakHashMap to prevent reference leak of Destinations

auto-update
Zlatin Balevsky 2021-10-17 15:06:32 +01:00
parent 7a0e58e14a
commit cdf96f32a2
No known key found for this signature in database
GPG Key ID: A72832072D525E41
1 changed files with 1 additions and 2 deletions

View File

@ -3,7 +3,6 @@ package com.muwire.core.connection
import net.i2p.client.streaming.I2PSocketManager
import net.i2p.data.Destination
import java.util.concurrent.ConcurrentHashMap
import java.util.concurrent.Semaphore
class I2PConnector {
@ -12,7 +11,7 @@ class I2PConnector {
final I2PSocketManager socketManager
private final Map<Destination, Semaphore> limiter = new ConcurrentHashMap<>()
private final Map<Destination, Semaphore> limiter = Collections.synchronizedMap(new WeakHashMap<>())
I2PConnector() {}