fix(compiler-cli): fix memory leak in program creation (#20692)

Saving `oldProgram` in `AngularCompilerProgram` instances is causing a memory leak for unemitted programs.

It's not actually used so simply not saving it fixes the memory leak.

Fix #20691

PR Close #20692
This commit is contained in:
Filipe Silva 2017-11-29 15:45:09 +00:00 committed by Miško Hevery
parent 3def2cc552
commit 71e5de646b
1 changed files with 1 additions and 1 deletions

View File

@ -61,7 +61,7 @@ class AngularCompilerProgram implements Program {
constructor(
private rootNames: string[], private options: CompilerOptions, private host: CompilerHost,
private oldProgram?: Program) {
oldProgram?: Program) {
const [major, minor] = ts.version.split('.');
if (Number(major) < 2 || (Number(major) === 2 && Number(minor) < 4)) {
throw new Error('The Angular Compiler requires TypeScript >= 2.4.');