We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01c977a commit 4f5f960Copy full SHA for 4f5f960
src/main/kotlin/dev/silenium/libs/flows/impl/CloningFlow.kt
@@ -49,9 +49,8 @@ class CloningFlow<T : Reference<T>>(private val wrapped: Flow<T>? = null) : Flow
49
suspend fun publish(value: T): Unit = publishLock.withReentrantLock {
50
coroutineScope {
51
collectors.map { (_, collector) ->
52
- val item = value.clone().getOrThrow()
53
- launch {
54
- collector.emit(item)
+ value.clone().getOrThrow().use { item ->
+ launch { collector.emit(item) }
55
}
56
}.joinAll()
57
0 commit comments