Skip to content

Commit 9a7ee29

Browse files
authored
chore: Fix leak in PrefixAndTail. (#32625)
1 parent bc9c42b commit 9a7ee29

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

akka-stream/src/main/scala/akka/stream/impl/fusing/StreamOfStreams.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,9 @@ import scala.jdk.CollectionConverters._
225225
override def onUpstreamFinish(): Unit = {
226226
if (!prefixComplete) {
227227
// This handles the unpulled out case as well
228-
emit(out, (builder.result(), Source.empty), () => completeStage())
228+
val prefix = builder.result()
229+
builder = null // free for GC
230+
emit(out, (prefix, Source.empty), () => completeStage())
229231
} else {
230232
if (!tailSource.isClosed) tailSource.complete()
231233
completeStage()

0 commit comments

Comments
 (0)