properly dispose of buffer decoration
This commit is contained in:
@@ -63,6 +63,7 @@ export class BufferDecorationRenderer extends Disposable {
|
||||
let element = this._decorationElements.get(decoration);
|
||||
if (!element) {
|
||||
element = this._createElement(decoration);
|
||||
decoration.onDispose(() => this._removeDecoration(decoration));
|
||||
this._decorationElements.set(decoration, element);
|
||||
this._container.appendChild(element);
|
||||
}
|
||||
|
||||
@@ -65,6 +65,11 @@ class Decoration extends Disposable implements IInternalDecoration {
|
||||
) {
|
||||
super();
|
||||
this.marker = options.marker;
|
||||
// TODO: Make sure dispose doesn't need to do anything else?
|
||||
this.marker.onDispose(() => this.dispose());
|
||||
}
|
||||
public override dispose(): void {
|
||||
this.element?.remove();
|
||||
this._onDispose.fire();
|
||||
super.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user