Skip to content

Commit 1d30bd0

Browse files
committed
Avoid memory leak in TypedSplice (reverted from commit 016c5d7)
1 parent 016c5d7 commit 1d30bd0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/src/dotty/tools/dotc/ast/untpd.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ object untpd extends Trees.Instance[Untyped] with UntypedTreeInfo {
2929
}
3030

3131
object TypedSplice {
32-
def apply(tree: tpd.Tree)(implicit ctx: Context): TypedSplice = {
33-
val curOwner = ctx.owner // compute here to avoid space leak with a reference from TypedSplice to Context
34-
new TypedSplice(tree)(curOwner) {}
35-
}
32+
def apply(tree: tpd.Tree)(implicit ctx: Context): TypedSplice =
33+
new TypedSplice(tree)(ctx.owner) {}
3634
}
3735

3836
/** mods object name impl */

0 commit comments

Comments
 (0)