From da13ae543eea00f86e53b8564f8ee40585c3dfcf Mon Sep 17 00:00:00 2001 From: George Vavilov <35401860+doritosxxx@users.noreply.github.com> Date: Mon, 8 Apr 2024 23:43:06 +0300 Subject: [PATCH] fix: memory leak --- src/zoom.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/zoom.ts b/src/zoom.ts index 622fe7e..e42c5d6 100644 --- a/src/zoom.ts +++ b/src/zoom.ts @@ -28,8 +28,8 @@ export class Zoom { window.addEventListener('pointermove', this.move) window.addEventListener('pointerup', this.up) - window.addEventListener('contextmenu', this.contextmenu) window.addEventListener('pointercancel', this.up) + window.addEventListener('contextmenu', this.contextmenu) } protected wheel = (e: WheelEvent) => { @@ -113,5 +113,6 @@ export class Zoom { window.removeEventListener('pointermove', this.move) window.removeEventListener('pointerup', this.up) window.removeEventListener('pointercancel', this.up) + window.removeEventListener('contextmenu', this.contextmenu) } }