Skip to content

Commit ee1350b

Browse files
committed
dispose snapshot only if new file differs from the old file
1 parent 726eea2 commit ee1350b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/services.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1878,7 +1878,7 @@ module ts {
18781878
newSourceFile.nameTable = undefined;
18791879

18801880
// dispose all resources held by old script snapshot
1881-
if (sourceFile.scriptSnapshot) {
1881+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
18821882
if (sourceFile.scriptSnapshot.dispose) {
18831883
sourceFile.scriptSnapshot.dispose();
18841884
}

0 commit comments

Comments
 (0)