dispose native policy service on shutdown

This commit is contained in:
João Moreno
2022-05-19 13:56:04 +02:00
parent 7ce1b0f885
commit 04e34f2554
2 changed files with 8 additions and 6 deletions

View File

@@ -133,8 +133,8 @@ class CliMain extends Disposable {
fileService.registerProvider(Schemas.file, diskFileSystemProvider);
// Policy
const policyService = isWindows && productService.win32RegValueName ? new NativePolicyService(productService.win32RegValueName)
: environmentService.policyFile ? new FilePolicyService(environmentService.policyFile, fileService, logService)
const policyService = isWindows && productService.win32RegValueName ? this._register(new NativePolicyService(productService.win32RegValueName))
: environmentService.policyFile ? this._register(new FilePolicyService(environmentService.policyFile, fileService, logService))
: new NullPolicyService();
services.set(IPolicyService, policyService);