Skip to content

Commit

Permalink
workaround ConcurrentModificationException when closeAllScopes in js
Browse files Browse the repository at this point in the history
Fixes gh-1963
  • Loading branch information
luozejiaqun committed Oct 25, 2024
1 parent 4c56aa0 commit f649e59
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ class ScopeRegistry(private val _koin: Koin) {
}

private fun closeAllScopes() {
_scopes.values.toList().forEach { scope ->
// use another list to workaround ConcurrentModificationException
val scopes = List(_scopes.values.size) { _scopes.values.elementAt(it) }
scopes.forEach { scope ->
scope.close()
}
}
Expand Down

0 comments on commit f649e59

Please sign in to comment.