Skip to content

Commit b7ee4aa

Browse files
authored
Merge pull request #448 from Caparow/scala2-feature-clean-thread-locals-causing-oom
Removing ThreadLocals on finish to clean up CompileTimeStack.
2 parents 490d4bf + a4eb9bd commit b7ee4aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/scala/magnolia1/magnolia.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,8 +903,8 @@ private[magnolia1] object CompileTimeState {
903903
val depth = c.enclosingMacros.count(m => workSet(m.macroApplication.symbol))
904904
try fn(stack.asInstanceOf[Stack[c.type]], depth)
905905
finally if (depth <= 1) {
906-
stack.clear()
907-
workSet.clear()
906+
threadLocalStack.remove()
907+
threadLocalWorkSet.remove()
908908
}
909909
}
910910
}

0 commit comments

Comments
 (0)