@@ -8,7 +8,7 @@ import * as dom from 'vs/base/browser/dom';
8
8
import * as languages from 'vs/editor/common/languages' ;
9
9
import { ActionsOrientation , ActionBar } from 'vs/base/browser/ui/actionbar/actionbar' ;
10
10
import { 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' ;
12
12
import { URI } from 'vs/base/common/uri' ;
13
13
import { ITextModel } from 'vs/editor/common/model' ;
14
14
import { IModelService } from 'vs/editor/common/services/model' ;
@@ -576,12 +576,10 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
576
576
577
577
this . _commentEditorModel ?. dispose ( ) ;
578
578
579
- this . _commentEditorDisposables . forEach ( dispose => dispose . dispose ( ) ) ;
579
+ dispose ( this . _commentEditorDisposables ) ;
580
580
this . _commentEditorDisposables = [ ] ;
581
- if ( this . _commentEditor ) {
582
- this . _commentEditor . dispose ( ) ;
583
- this . _commentEditor = null ;
584
- }
581
+ this . _commentEditor ?. dispose ( ) ;
582
+ this . _commentEditor = null ;
585
583
586
584
this . _commentEditContainer ! . remove ( ) ;
587
585
}
@@ -766,6 +764,11 @@ export class CommentNode<T extends IRange | ICellRange> extends Disposable {
766
764
} , 3000 ) ;
767
765
}
768
766
}
767
+
768
+ override dispose ( ) : void {
769
+ super . dispose ( ) ;
770
+ dispose ( this . _commentEditorDisposables ) ;
771
+ }
769
772
}
770
773
771
774
function 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