mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-11-18 20:11:14 +00:00
dispose snapshot only if new file differs from the old file
This commit is contained in:
1 parent
726eea2896
commit
ee1350b40e
1 file changed
+1
-1
@@ -1878,7 +1878,7 @@ module ts {
|
||||
newSourceFile.nameTable = undefined;
|
||||
|
||||
// dispose all resources held by old script snapshot
|
||||
if (sourceFile.scriptSnapshot) {
|
||||
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
|
||||
if (sourceFile.scriptSnapshot.dispose) {
|
||||
sourceFile.scriptSnapshot.dispose();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user