Change:
New SelectBox custom implementation creates a circular disposal since toDispose is still passed to the select box delegate where the class objects are into the disposable list which is really the parents list. Steps to Reproduce: code, open a terminal (instantiates the drop-down lists) panel (disposes SelectBox) gives a stack err, panel becomes blank and unusable shows an infinite disposal loop. Debug on disposal: [7432:1218/.472:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.472:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.472:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.472:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.473:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.473:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.473:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.473:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.474:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.474:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.474:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.475:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.475:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.476:INFO:CONSOLE(442)] "Dispose 14", source: file:///C:/VSC Dev/vc-fork- (442) [7432:1218/.476:INFO:CONSOLE(85)] "Maximum call stack size exceeded: RangeError: Maximum call stack size exceeded at Array.forEach (native) at Object.dispose (file:///C:/VSC Dev/vc-fork-) at SelectBoxList.dispose (file:///C:/VSC Dev/vc-fork-) at file:///C:/VSC Dev/vc-fork- at Array.forEach (native) at Object.dispose (file:///C:/VSC Dev/vc-fork-) at SelectBoxList.dispose (file:///C:/VSC Dev/vc-fork-) at file:///C:/VSC Dev/vc-fork- at Array.forEach (native) at Object.dispose (file:///C:/VSC Dev/vc-fork-)", source: file:///C:/VSC Dev/vc-fork- (85)
Fixed with

Discussion:
// Instantiate select implementation based on platform if (isMacintosh) { <del> this.selectBoxDelegate = new SelectBoxNative(options, selected, styles, this.toDispose); </del> <ins> this.selectBoxDelegate = new SelectBoxNative(options, selected, styles); </ins> } else { <del> this.selectBoxDelegate = new SelectBoxList(options, selected, contextViewProvider, styles, this.toDispose); </del> <ins> this.selectBoxDelegate = new SelectBoxList(options, selected, contextViewProvider, styles); </ins> } this.toDispose.push(this.selectBoxDelegate);

public dispose(): void { this.toDispose = dispose(this.toDispose); super.dispose(); } }  No newline at end of file

private selectDropDownListContainer: HTMLElement; private widthControlElement: HTMLElement; <del> constructor(options: string[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles, toDispose: IDisposable[]) { </del> <ins> constructor(options: string[], selected: number, contextViewProvider: IContextViewProvider, styles: ISelectBoxStyles) { </ins> <del> // Disposables handled by caller this.toDispose = toDispose; </del> <ins> this.toDispose = []; </ins> this.selectElement = document.createElement('select'); this.selectElement.className = 'select-box';

private toDispose: IDisposable[]; private styles: ISelectBoxStyles; <del> constructor(options: string[], selected: number, styles: ISelectBoxStyles, toDispose: IDisposable[]) { </del> <ins> constructor(options: string[], selected: number, styles: ISelectBoxStyles) { this.toDispose = []; </ins> this.selectElement = document.createElement('select'); this.selectElement.className = 'select-box'; <del> this.toDispose = toDispose; </del> this._onDidSelect = new Emitter<ISelectData>(); this.styles = styles;