summaryrefslogtreecommitdiff
path: root/opendc-faas/opendc-faas-service/src
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-faas/opendc-faas-service/src')
-rw-r--r--opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt3
1 files changed, 2 insertions, 1 deletions
diff --git a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt
index 1cc33f6f..d953f737 100644
--- a/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt
+++ b/opendc-faas/opendc-faas-service/src/main/kotlin/org/opendc/faas/service/FunctionObject.kt
@@ -129,7 +129,8 @@ public class FunctionObject(
}
override fun close() {
- instances.forEach(FunctionInstance::close)
+ val copy = instances.toList() // Make copy to prevent concurrent modification
+ copy.forEach(FunctionInstance::close)
instances.clear()
}