Skip to content

Commit

Permalink
fix: Fix a leak in PrefixAndTail operator. (apache#1623)
Browse files Browse the repository at this point in the history
  • Loading branch information
He-Pin authored Jan 3, 2025
1 parent 2b6d2dc commit d34927b
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 d34927b

Please sign in to comment.