fix: Fix a leak in PrefixAndTail operator. (#1623)
This commit is contained in:
parent
2b6d2dc0a0
commit
d34927b56b
1 changed files with 3 additions and 1 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue