File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
OneSignalSDK/onesignal/core/src/main/java/com/onesignal/common/events Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package com.onesignal.common.events
3
3
import com.onesignal.common.threading.suspendifyOnMain
4
4
import kotlinx.coroutines.Dispatchers
5
5
import kotlinx.coroutines.withContext
6
+ import java.util.*
6
7
7
8
/* *
8
9
* A standard implementation that implements [IEventNotifier] and additional functionality to make
@@ -13,7 +14,7 @@ open class EventProducer<THandler> : IEventNotifier<THandler> {
13
14
override val hasSubscribers: Boolean
14
15
get() = _subscribers .any()
15
16
16
- private val _subscribers : MutableList <THandler > = mutableListOf ()
17
+ private val _subscribers : MutableList <THandler > = Collections .synchronizedList( mutableListOf () )
17
18
18
19
override fun subscribe (handler : THandler ) {
19
20
_subscribers .add(handler)
You can’t perform that action at this time.
0 commit comments