File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2487,6 +2487,10 @@ module ts {
24872487 }
24882488 }
24892489
2490+ // hostCache is captured in the closure for 'getOrCreateSourceFile' but it should not be used past this point.
2491+ // It needs to be cleared to allow all collected snapshots to be released
2492+ hostCache = undefined ;
2493+
24902494 program = newProgram ;
24912495
24922496 // Make sure all the nodes in the program are both bound, and have their parent
@@ -2495,6 +2499,7 @@ module ts {
24952499 return ;
24962500
24972501 function getOrCreateSourceFile ( fileName : string ) : SourceFile {
2502+ Debug . assert ( hostCache !== undefined ) ;
24982503 // The program is asking for this file, check first if the host can locate it.
24992504 // If the host can not locate the file, then it does not exist. return undefined
25002505 // to the program to allow reporting of errors for missing files.
You can’t perform that action at this time.
0 commit comments