fix a concurrent modification exception
This commit is contained in:
parent
3f8d7a09f4
commit
eba74d7799
1 changed files with 3 additions and 3 deletions
|
@ -15,14 +15,14 @@ import java.util.*
|
|||
|
||||
// https://stackoverflow.com/a/8127953
|
||||
class MyPath : Path(), Serializable {
|
||||
|
||||
val actions = LinkedList<Action>()
|
||||
|
||||
private fun readObject(inputStream: ObjectInputStream) {
|
||||
inputStream.defaultReadObject()
|
||||
|
||||
for (action in actions) {
|
||||
action.perform(this)
|
||||
val copiedActions = actions.map { it }
|
||||
copiedActions.forEach {
|
||||
it.perform(this)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue