@@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom';
88import * as languages from 'vs/editor/common/languages' ;
99import { ActionsOrientation , ActionBar } from 'vs/base/browser/ui/actionbar/actionbar' ;
1010import { Action , IActionRunner , IAction , Separator , ActionRunner } from 'vs/base/common/actions' ;
11- import { Disposable , IDisposable } from 'vs/base/common/lifecycle' ;
11+ import { Disposable , IDisposable , dispose } from 'vs/base/common/lifecycle' ;
1212import { URI } from 'vs/base/common/uri' ;
1313import { ITextModel } from 'vs/editor/common/model' ;
1414import { IModelService } from 'vs/editor/common/services/model' ;
@@ -576,12 +576,10 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
576576
577577 this . _commentEditorModel ?. dispose ( ) ;
578578
579- this . _commentEditorDisposables . forEach ( dispose => dispose . dispose ( ) ) ;
579+ dispose ( this . _commentEditorDisposables ) ;
580580 this . _commentEditorDisposables = [ ] ;
581- if ( this . _commentEditor ) {
582- this . _commentEditor . dispose ( ) ;
583- this . _commentEditor = null ;
584- }
581+ this . _commentEditor ?. dispose ( ) ;
582+ this . _commentEditor = null ;
585583
586584 this . _commentEditContainer ! . remove ( ) ;
587585 }
@@ -766,6 +764,11 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
766764 } , 3000 ) ;
767765 }
768766 }
767+
768+ override dispose ( ) : void {
769+ super . dispose ( ) ;
770+ dispose ( this . _commentEditorDisposables ) ;
771+ }
769772}
770773
771774function fillInActions ( groups : [ string , Array < MenuItemAction | SubmenuItemAction > ] [ ] , target : IAction [ ] | { primary : IAction [ ] ; secondary : IAction [ ] } , useAlternativeActions : boolean , isPrimaryGroup : ( group : string ) => boolean = group => group === 'navigation' ) : void {
0 commit comments