diff --git a/extensions/php/src/features/validationProvider.ts b/extensions/php/src/features/validationProvider.ts index d02352898d2..a49821d6991 100644 --- a/extensions/php/src/features/validationProvider.ts +++ b/extensions/php/src/features/validationProvider.ts @@ -121,6 +121,10 @@ export default class PHPValidationProvider { public dispose(): void { this.diagnosticCollection.clear(); this.diagnosticCollection.dispose(); + if (this.documentListener) { + this.documentListener.dispose(); + this.documentListener = null; + } } private loadConfiguration(): void { @@ -293,4 +297,4 @@ export default class PHPValidationProvider { } vscode.window.showInformationMessage(message); } -} \ No newline at end of file +}