Fix TS order of initilization issue around dispose and _register
By overriding _register in this case, we could end up invoking this function on a subclass that had not actually been inited yet (when `_toDispose` has not been set). I believe the overriding was an accident, so the fix is to remove it
This commit is contained in:
parent
d44c5f4731
commit
b86bdf8a0b
1 changed files with 0 additions and 12 deletions
|
@ -1699,21 +1699,9 @@ export class SearchView extends ViewletPanel {
|
|||
super.saveState();
|
||||
}
|
||||
|
||||
private _toDispose: IDisposable[] = [];
|
||||
protected _register<T extends IDisposable>(t: T): T {
|
||||
if (this.isDisposed) {
|
||||
console.warn('Registering disposable on object that has already been disposed.');
|
||||
t.dispose();
|
||||
} else {
|
||||
this._toDispose.push(t);
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
dispose(): void {
|
||||
this.isDisposed = true;
|
||||
this.saveState();
|
||||
this._toDispose = dispose(this._toDispose);
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue