wire-up dispose calls, #9384

This commit is contained in:
Johannes Rieken
2016-08-29 18:09:29 +02:00
parent 0ed5aef173
commit a27782ed13
6 changed files with 122 additions and 2 deletions

View File

@@ -48,7 +48,11 @@ export class ExtHostCommands extends ExtHostCommandsShape {
this._commands[id] = { callback, thisArg, description };
this._proxy.$registerCommand(id);
return new extHostTypes.Disposable(() => delete this._commands[id]);
return new extHostTypes.Disposable(() => {
if (delete this._commands[id]) {
this._proxy.$unregisterCommand(id);
}
});
}
executeCommand<T>(id: string, ...args: any[]): Thenable<T> {