Skip to content

Commit eba74d7

Browse files
committed
fix a concurrent modification exception
1 parent 3f8d7a0 commit eba74d7

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • app/src/main/kotlin/com/simplemobiletools/draw/models

app/src/main/kotlin/com/simplemobiletools/draw/models/MyPath.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ import java.util.*
1515

1616
// https://stackoverflow.com/a/8127953
1717
class MyPath : Path(), Serializable {
18-
1918
val actions = LinkedList<Action>()
2019

2120
private fun readObject(inputStream: ObjectInputStream) {
2221
inputStream.defaultReadObject()
2322

24-
for (action in actions) {
25-
action.perform(this)
23+
val copiedActions = actions.map { it }
24+
copiedActions.forEach {
25+
it.perform(this)
2626
}
2727
}
2828

0 commit comments

Comments
 (0)