clean up some disposable use (#6832)

This commit is contained in:
Anthony Dresser
2019-08-20 14:34:13 -07:00
committed by GitHub
parent 54cf062737
commit c540e81108
23 changed files with 139 additions and 244 deletions

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
import {
SqlExtHostContext, ExtHostCredentialManagementShape,
MainThreadCredentialManagementShape, SqlMainContext
@@ -14,27 +14,22 @@ import { IExtHostContext } from 'vs/workbench/api/common/extHost.protocol';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
@extHostNamedCustomer(SqlMainContext.MainThreadCredentialManagement)
export class MainThreadCredentialManagement implements MainThreadCredentialManagementShape {
export class MainThreadCredentialManagement extends Disposable implements MainThreadCredentialManagementShape {
private _proxy: ExtHostCredentialManagementShape;
private _toDispose: IDisposable[];
private _registrations: { [handle: number]: IDisposable; } = Object.create(null);
private _registrations: { [handle: number]: IDisposable; } = Object.create(null); // should we be registering these disposables?
constructor(
extHostContext: IExtHostContext,
@ICredentialsService private credentialService: ICredentialsService
) {
super();
if (extHostContext) {
this._proxy = extHostContext.getProxy(SqlExtHostContext.ExtHostCredentialManagement);
}
}
public dispose(): void {
this._toDispose = dispose(this._toDispose);
}
public $registerCredentialProvider(handle: number): Promise<any> {
let self = this;