File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -2487,6 +2487,10 @@ module ts {
2487
2487
}
2488
2488
}
2489
2489
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
+
2490
2494
program = newProgram ;
2491
2495
2492
2496
// Make sure all the nodes in the program are both bound, and have their parent
@@ -2495,6 +2499,7 @@ module ts {
2495
2499
return ;
2496
2500
2497
2501
function getOrCreateSourceFile ( fileName : string ) : SourceFile {
2502
+ Debug . assert ( hostCache !== undefined ) ;
2498
2503
// The program is asking for this file, check first if the host can locate it.
2499
2504
// If the host can not locate the file, then it does not exist. return undefined
2500
2505
// to the program to allow reporting of errors for missing files.
You can’t perform that action at this time.
0 commit comments