From d8573e38a8570c047a329eaf90a8f7e90b92a2f3 Mon Sep 17 00:00:00 2001 From: meganrogge Date: Fri, 11 Feb 2022 15:01:07 -0600 Subject: [PATCH] cleanup dispose --- src/browser/services/DecorationService.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/browser/services/DecorationService.ts b/src/browser/services/DecorationService.ts index 28f18a78..c9875610 100644 --- a/src/browser/services/DecorationService.ts +++ b/src/browser/services/DecorationService.ts @@ -126,9 +126,13 @@ export class Decoration extends Disposable implements IDecoration { if (this.isDisposed) { return; } - this._container.removeChild(this._element!); + if (!this.marker.isDisposed) { + this.marker.dispose(); + } + if (this._element) { + this._container.removeChild(this._element); + } this.isDisposed = true; - this._marker.dispose(); // Emit before super.dispose such that dispose listeners get a change to react this._onDispose.fire(); super.dispose();