Skip to content

Remove wheel listener during mouse cleanup - #7344

Open
schulerj89 wants to merge 1 commit into
phaserjs:masterfrom
schulerj89:agent/fix-mouse-wheel-listener-cleanup
Open

Remove wheel listener during mouse cleanup#7344
schulerj89 wants to merge 1 commit into
phaserjs:masterfrom
schulerj89:agent/fix-mouse-wheel-listener-cleanup

Conversation

@schulerj89

Copy link
Copy Markdown

Summary

Fixes #7340 by removing the canvas wheel listener with the same onMouseWheel callback during MouseManager.stopListeners. Adds a focused Vitest regression test that confirms the callback is registered, removed, and no longer fires after cleanup.

The stale listener was reproduced in current Phaser and 4.1.0. The claimed retention of the destroyed Game and broader memory leak could not be reproduced, so this change is limited to the confirmed listener cleanup defect.

Testing

  • npx vitest run tests/input/mouse/MouseManager.test.js --maxWorkers=1
  • npm run build

@schulerj89
schulerj89 marked this pull request as ready for review July 27, 2026 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MouseManager.stopListeners never removes the wheel listener — destroyed Game stays retained through the canvas

1 participant