Skip to content

Commit 7d6f8f3

Browse files
committed
dispose snapshot only if new file differs from the old file
1 parent ba3d2db commit 7d6f8f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/services/services.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1868,7 +1868,7 @@ namespace ts {
18681868
newSourceFile.nameTable = undefined;
18691869

18701870
// dispose all resources held by old script snapshot
1871-
if (sourceFile.scriptSnapshot) {
1871+
if (sourceFile !== newSourceFile && sourceFile.scriptSnapshot) {
18721872
if (sourceFile.scriptSnapshot.dispose) {
18731873
sourceFile.scriptSnapshot.dispose();
18741874
}

0 commit comments

Comments
 (0)