mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-28 16:39:00 +01:00
fix: memory leak in sticky scroll (#271102)
* fix: memory leak in sticky scroll * simplify --------- Co-authored-by: Benjamin Pasero <benjamin.pasero@gmail.com>
This commit is contained in:
co-authored by
Benjamin Pasero
parent
443cc8e89f
commit
a2067fe643
@@ -51,7 +51,7 @@ const STICKY_IS_FOLDING_ICON_ATTR = 'data-sticky-is-folding-icon';
|
||||
|
||||
export class StickyScrollWidget extends Disposable implements IOverlayWidget {
|
||||
|
||||
private readonly _foldingIconStore = new DisposableStore();
|
||||
private readonly _foldingIconStore = this._register(new DisposableStore());
|
||||
private readonly _rootDomNode: HTMLElement = document.createElement('div');
|
||||
private readonly _lineNumbersDomNode: HTMLElement = document.createElement('div');
|
||||
private readonly _linesDomNodeScrollable: HTMLElement = document.createElement('div');
|
||||
@@ -118,7 +118,6 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
|
||||
updateScrollLeftPosition();
|
||||
this._updateWidgetWidth();
|
||||
}));
|
||||
this._register(this._foldingIconStore);
|
||||
updateScrollLeftPosition();
|
||||
|
||||
this._register(this._editor.onDidLayoutChange((e) => {
|
||||
@@ -283,6 +282,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
|
||||
if (showFoldingControls !== 'mouseover') {
|
||||
return;
|
||||
}
|
||||
this._foldingIconStore.clear();
|
||||
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_ENTER, () => {
|
||||
this._isOnGlyphMargin = true;
|
||||
this._setFoldingIconsVisibility(true);
|
||||
|
||||
Reference in New Issue
Block a user