fix: Access to state register using synchronized block
This commit is contained in:
parent
eae30c738a
commit
c662c8378c
|
@ -263,7 +263,9 @@ class RememberStateFlowScopeImpl(
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun <T> mutableComposeState(sink: MutableStateFlow<T>): MutableState<T> {
|
override fun <T> mutableComposeState(sink: MutableStateFlow<T>): MutableState<T> {
|
||||||
val entry = registry.values.firstOrNull { it.sink === sink }
|
val entry = synchronized(this) {
|
||||||
|
registry.values.firstOrNull { it.sink === sink }
|
||||||
|
}
|
||||||
requireNotNull(entry) {
|
requireNotNull(entry) {
|
||||||
"Provided sink must be created using mutablePersistedFlow(...)!"
|
"Provided sink must be created using mutablePersistedFlow(...)!"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue