Skip to content

Commit 02b367b

Browse files
committed
1 parent ebaa7b5 commit 02b367b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/vs/workbench/services/configuration/common/jsonEditingService.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,13 @@ export class JSONEditingService implements IJSONEditingService {
110110
const model = reference.object.textEditorModel;
111111

112112
if (this.hasParseErrors(model)) {
113+
reference.dispose();
113114
return this.reject<IReference<IResolvedTextEditorModel>>(JSONEditingErrorCode.ERROR_INVALID_FILE);
114115
}
115116

116117
// Target cannot be dirty if not writing into buffer
117118
if (checkDirty && this.textFileService.isDirty(resource)) {
119+
reference.dispose();
118120
return this.reject<IReference<IResolvedTextEditorModel>>(JSONEditingErrorCode.ERROR_FILE_DIRTY);
119121
}
120122

0 commit comments

Comments
 (0)