From 0b6a56f20ae9d784c26b035ebe80a7b795ab1bd0 Mon Sep 17 00:00:00 2001 From: Sandeep Somavarapu Date: Mon, 19 Feb 2018 11:16:01 +0100 Subject: [PATCH] #41571: Fix in Windows platform --- .../services/configuration/node/configuration.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vs/workbench/services/configuration/node/configuration.ts b/src/vs/workbench/services/configuration/node/configuration.ts index 8c8a7349406..3a91b6124be 100644 --- a/src/vs/workbench/services/configuration/node/configuration.ts +++ b/src/vs/workbench/services/configuration/node/configuration.ts @@ -96,8 +96,7 @@ export class WorkspaceConfiguration extends Disposable { const defaultConfig = new WorkspaceConfigurationModelParser(this._workspaceConfigPath.fsPath); defaultConfig.parse(JSON.stringify({ folders: [] } as IStoredWorkspace, null, '\t')); if (this._workspaceConfigurationWatcher) { - this.stopListeningToWatcher(); - this._workspaceConfigurationWatcher.dispose(); + this.disposeConfigurationWatcher(); } this._workspaceConfigurationWatcher = new ConfigWatcher(this._workspaceConfigPath.fsPath, { changeBufferDelay: 300, @@ -158,8 +157,15 @@ export class WorkspaceConfiguration extends Disposable { this._cache = this._workspaceConfigurationModelParser.settingsModel.merge(this._workspaceConfigurationModelParser.launchModel); } + private disposeConfigurationWatcher(): void { + this.stopListeningToWatcher(); + if (this._workspaceConfigurationWatcher) { + this._workspaceConfigurationWatcher.dispose(); + } + } + dispose(): void { - dispose(this._workspaceConfigurationWatcherDisposables); + this.disposeConfigurationWatcher(); super.dispose(); } } -- GitLab