mirror of
https://github.com/vector-im/element-android.git
synced 2024-11-15 01:35:07 +08:00
Merge pull request #6362 from vector-im/bugfix/adm/dispatch-to-crash
Fixing concurrent `dispatchTo` crash
This commit is contained in:
commit
9925cf9996
1
changelog.d/5821.bugfix
Normal file
1
changelog.d/5821.bugfix
Normal file
@ -0,0 +1 @@
|
||||
Fixes concurrent modification crash when signing out or launching the app
|
@ -19,12 +19,13 @@ package org.matrix.android.sdk.internal.session
|
||||
import org.matrix.android.sdk.api.extensions.tryOrNull
|
||||
import org.matrix.android.sdk.api.session.Session
|
||||
import timber.log.Timber
|
||||
import java.util.concurrent.CopyOnWriteArraySet
|
||||
import javax.inject.Inject
|
||||
|
||||
@SessionScope
|
||||
internal class SessionListeners @Inject constructor() {
|
||||
|
||||
private val listeners = mutableSetOf<Session.Listener>()
|
||||
private val listeners = CopyOnWriteArraySet<Session.Listener>()
|
||||
|
||||
fun addListener(listener: Session.Listener) {
|
||||
synchronized(listeners) {
|
||||
|
Loading…
Reference in New Issue
Block a user