Skip to content

Commit

Permalink
fix: memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
doritosxxx authored and Ni55aN committed Oct 12, 2024
1 parent 011f65e commit da13ae5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down Expand Up @@ -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)
}
}

0 comments on commit da13ae5

Please sign in to comment.