Clean up some usages of IDisposable[]

Part of #74250

- Extend `Disposable` in classes where it makes sense
- Use `DisposableStore` for lists of disposables
- Make `combinedDisposable` take arguments instead of an array (so that you can't pass in an array and then modify the array after the fact)
This commit is contained in:
Matt Bierner
2019-05-23 22:58:16 -07:00
parent 5e1f9440d2
commit 0f32f0ef5f
62 changed files with 396 additions and 468 deletions

View File

@@ -165,12 +165,12 @@ function main(server: Server, initData: ISharedProcessInitData, configuration: I
// update localizations cache
(localizationsService as LocalizationsService).update();
// cache clean ups
disposables.push(combinedDisposable([
disposables.push(combinedDisposable(
instantiationService2.createInstance(NodeCachedDataCleaner),
instantiationService2.createInstance(LanguagePackCachedDataCleaner),
instantiationService2.createInstance(StorageDataCleaner),
instantiationService2.createInstance(LogsDataCleaner)
]));
));
disposables.push(extensionManagementService as ExtensionManagementService);
});
});