Skip to content

Commit 706a2ab

Browse files
committed
Revert "feat: close items after collection in CloningFlow"
This reverts commit 4f5f960.
1 parent 4f5f960 commit 706a2ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/kotlin/dev/silenium/libs/flows/impl/CloningFlow.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ class CloningFlow<T : Reference<T>>(private val wrapped: Flow<T>? = null) : Flow
4949
suspend fun publish(value: T): Unit = publishLock.withReentrantLock {
5050
coroutineScope {
5151
collectors.map { (_, collector) ->
52-
value.clone().getOrThrow().use { item ->
53-
launch { collector.emit(item) }
52+
val item = value.clone().getOrThrow()
53+
launch {
54+
collector.emit(item)
5455
}
5556
}.joinAll()
5657
}

0 commit comments

Comments
 (0)