Skip to content

Commit

Permalink
Merge pull request #448 from Caparow/scala2-feature-clean-thread-loca…
Browse files Browse the repository at this point in the history
…ls-causing-oom

Removing ThreadLocals on finish to clean up CompileTimeStack.
  • Loading branch information
adamw authored Jan 14, 2023
2 parents 490d4bf + a4eb9bd commit b7ee4aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/magnolia1/magnolia.scala
Original file line number Diff line number Diff line change
Expand Up @@ -903,8 +903,8 @@ private[magnolia1] object CompileTimeState {
val depth = c.enclosingMacros.count(m => workSet(m.macroApplication.symbol))
try fn(stack.asInstanceOf[Stack[c.type]], depth)
finally if (depth <= 1) {
stack.clear()
workSet.clear()
threadLocalStack.remove()
threadLocalWorkSet.remove()
}
}
}
Expand Down

0 comments on commit b7ee4aa

Please sign in to comment.