Fix a ConcurrentModificationException in PacketsAdapter.tick
This commit is contained in:
parent
9aab2b1adc
commit
36ae79fe88
1 changed files with 2 additions and 2 deletions
|
@ -22,8 +22,8 @@ import space.uranos.util.awaitSuspending
|
|||
class PacketsAdapter(val session: UranosSession) {
|
||||
private val packetsForNextTick = ArrayList<OutgoingPacket>()
|
||||
|
||||
suspend fun tick() {
|
||||
packetsForNextTick.forEach { send(it) } // TODO: Fix ConcurrentModificationException
|
||||
suspend fun tick() = withContext(session.coroutineContext) {
|
||||
packetsForNextTick.forEach { send(it) }
|
||||
packetsForNextTick.clear()
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue