Fix ConcurrentModification

This commit is contained in:
Mygod
2019-07-17 16:21:37 +08:00
parent f599e2fe3d
commit 7a4264e2df
2 changed files with 7 additions and 6 deletions

View File

@@ -330,7 +330,7 @@ class Routing(private val caller: Any, private val downstream: String) : IpNeigh
stop()
Timber.i("Stopped routing for $downstream by $caller")
TrafficRecorder.update() // record stats before exiting to prevent stats losing
clients.values.forEach { it.close() }
synchronized(this) { clients.values.forEach { it.close() } }
currentDns?.transaction?.revert()
fallbackUpstream.subrouting?.transaction?.revert()
upstream.subrouting?.transaction?.revert()