mirror of
https://github.com/microsoft/vscode.git
synced 2026-06-08 16:46:42 +01:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user