mirror of
https://github.com/microg/GmsCore.git
synced 2025-11-07 18:30:43 +00:00
Maps: Fix ConconcurrentModificationException (#2210)
Co-authored-by: Marvin W <git@larma.de>
This commit is contained in:
co-authored by
Marvin W
parent
d3d0e65109
commit
ca02b7764d
+10
-9
@@ -862,15 +862,16 @@ class GoogleMapImpl(context: Context, var options: GoogleMapOptions) : AbstractG
|
||||
}
|
||||
|
||||
val runCallbacks = {
|
||||
synchronized(mapLock) {
|
||||
userOnInitializedCallbackList.forEach {
|
||||
try {
|
||||
it.onMapReady(this)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, e)
|
||||
}
|
||||
}.also {
|
||||
userOnInitializedCallbackList.clear()
|
||||
val callbacks = synchronized(mapLock) {
|
||||
ArrayList(userOnInitializedCallbackList)
|
||||
.also { userOnInitializedCallbackList.clear() }
|
||||
}
|
||||
|
||||
callbacks.forEach {
|
||||
try {
|
||||
it.onMapReady(this)
|
||||
} catch (e: Exception) {
|
||||
Log.w(TAG, e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user