Skip to content

Commit

Permalink
fix: Fix a leak in PrefixAndTail operator.
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin committed Dec 28, 2024
1 parent 2cd8313 commit 42cca6b
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,9 @@ import pekko.util.ccompat.JavaConverters._
override def onUpstreamFinish(): Unit = {
if (!prefixComplete) {
// This handles the unpulled out case as well
emit(out, (builder.result(), Source.empty), () => completeStage())
val prefix = builder.result();
builder = null // free for GC
emit(out, (prefix, Source.empty), () => completeStage())
} else {
if (!tailSource.isClosed) tailSource.complete()
completeStage()
Expand Down

0 comments on commit 42cca6b

Please sign in to comment.