Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rbuckton committed Jun 2, 2015
2 parents 6ef162d + f79f5bb commit 2cb0dfd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/services/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2475,6 +2475,10 @@ module ts {
}
}

// hostCache is captured in the closure for 'getOrCreateSourceFile' but it should not be used past this point.
// It needs to be cleared to allow all collected snapshots to be released
hostCache = undefined;

program = newProgram;

// Make sure all the nodes in the program are both bound, and have their parent
Expand All @@ -2483,6 +2487,7 @@ module ts {
return;

function getOrCreateSourceFile(fileName: string): SourceFile {
Debug.assert(hostCache !== undefined);
// The program is asking for this file, check first if the host can locate it.
// If the host can not locate the file, then it does not exist. return undefined
// to the program to allow reporting of errors for missing files.
Expand Down

0 comments on commit 2cb0dfd

Please sign in to comment.