mirror of
https://github.com/SimpleMobileTools/Simple-Draw.git
synced 2025-02-21 14:10:42 +01:00
fix a concurrent modification exception
This commit is contained in:
parent
3f8d7a09f4
commit
eba74d7799
@ -15,14 +15,14 @@ import java.util.*
|
|||||||
|
|
||||||
// https://stackoverflow.com/a/8127953
|
// https://stackoverflow.com/a/8127953
|
||||||
class MyPath : Path(), Serializable {
|
class MyPath : Path(), Serializable {
|
||||||
|
|
||||||
val actions = LinkedList<Action>()
|
val actions = LinkedList<Action>()
|
||||||
|
|
||||||
private fun readObject(inputStream: ObjectInputStream) {
|
private fun readObject(inputStream: ObjectInputStream) {
|
||||||
inputStream.defaultReadObject()
|
inputStream.defaultReadObject()
|
||||||
|
|
||||||
for (action in actions) {
|
val copiedActions = actions.map { it }
|
||||||
action.perform(this)
|
copiedActions.forEach {
|
||||||
|
it.perform(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user