From 85fde2f17cb7ab3bc22956e39eff7cdab8ade7f6 Mon Sep 17 00:00:00 2001 From: Simon Siefke Date: Fri, 1 Dec 2023 22:07:47 +0100 Subject: [PATCH] fix: memory leak in color picker widget --- .../contrib/colorPicker/browser/colorPickerWidget.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts index 5e245dfb4a222..d7fc9e51eb603 100644 --- a/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts +++ b/src/vs/editor/contrib/colorPicker/browser/colorPickerWidget.ts @@ -117,9 +117,9 @@ class CloseButton extends Disposable { const closeButton = dom.append(innerDiv, $('.button' + ThemeIcon.asCSSSelector(registerIcon('color-picker-close', Codicon.close, localize('closeIcon', 'Icon to close the color picker'))))); closeButton.classList.add('close-icon'); - this._button.onclick = () => { + this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { this._onClicked.fire(); - }; + })); } } @@ -455,9 +455,9 @@ export class InsertButton extends Disposable { this._button = dom.append(container, document.createElement('button')); this._button.classList.add('insert-button'); this._button.textContent = 'Insert'; - this._button.onclick = e => { + this._register(dom.addDisposableListener(this._button, dom.EventType.CLICK, () => { this._onClicked.fire(); - }; + })); } public get button(): HTMLElement {