mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
debt - fix some leaks found by copilot (#293685)
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import { getWindowId, onDidUnregisterWindow } from './dom.js';
|
||||
import { Emitter, Event } from '../common/event.js';
|
||||
import { Disposable, markAsSingleton } from '../common/lifecycle.js';
|
||||
import { Disposable, markAsSingleton, toDisposable } from '../common/lifecycle.js';
|
||||
|
||||
type BackingStoreContext = CanvasRenderingContext2D & {
|
||||
webkitBackingStorePixelRatio?: number;
|
||||
@@ -32,6 +32,8 @@ class DevicePixelRatioMonitor extends Disposable {
|
||||
this._listener = () => this._handleChange(targetWindow, true);
|
||||
this._mediaQueryList = null;
|
||||
this._handleChange(targetWindow, false);
|
||||
|
||||
this._register(toDisposable(() => this._mediaQueryList?.removeEventListener('change', this._listener)));
|
||||
}
|
||||
|
||||
private _handleChange(targetWindow: Window, fireEvent: boolean): void {
|
||||
|
||||
Reference in New Issue
Block a user