watcher - more dispose and remove E15 workaround (#213540)

This commit is contained in:
Benjamin Pasero 2024-05-27 13:49:49 +02:00 committed by GitHub
parent 4ed3738da5
commit 2f0b7c280e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View file

@ -89,6 +89,7 @@ export class UtilityProcessWorkerMainService extends Disposable implements IUtil
this.logService.trace(`[UtilityProcessWorker]: disposeWorker(window: ${configuration.reply.windowId}, moduleId: ${configuration.process.moduleId})`);
worker.kill();
worker.dispose();
this.workers.delete(workerId);
}
}
@ -98,7 +99,7 @@ class UtilityProcessWorker extends Disposable {
private readonly _onDidTerminate = this._register(new Emitter<IUtilityProcessWorkerProcessExit>());
readonly onDidTerminate = this._onDidTerminate.event;
private readonly utilityProcess = new WindowUtilityProcess(this.logService, this.windowsMainService, this.telemetryService, this.lifecycleMainService);
private readonly utilityProcess = this._register(new WindowUtilityProcess(this.logService, this.windowsMainService, this.telemetryService, this.lifecycleMainService));
constructor(
@ILogService private readonly logService: ILogService,

View file

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { DisposableStore, toDisposable } from 'vs/base/common/lifecycle';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { getDelayedChannel, ProxyChannel } from 'vs/base/parts/ipc/common/ipc';
import { IFileChange } from 'vs/platform/files/common/files';
import { AbstractUniversalWatcherClient, ILogMessage, IRecursiveWatcher } from 'vs/platform/files/common/watcher';
@ -53,13 +53,6 @@ export class UniversalWatcherClient extends AbstractUniversalWatcherClient {
return client.getChannel('watcher');
})()));
// Looks like universal watcher needs an explicit stop
// to prevent access on data structures after process
// exit. This only seem to be happening when used from
// Electron, not pure node.js.
// https://github.com/microsoft/vscode/issues/136264
disposables.add(toDisposable(() => watcher.stop()));
return watcher;
}
}