Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_onMouseOutGlobal event not unregistered #2344

Closed
soumak77 opened this issue Feb 19, 2016 · 2 comments
Closed

_onMouseOutGlobal event not unregistered #2344

soumak77 opened this issue Feb 19, 2016 · 2 comments

Comments

@soumak77
Copy link

When attempting to destroy a Phaser game instance (v2.4.6), I am seeing errors appear due to the _onMouseOutGlobal event being called after the game is destroyed. Looking at the source code I see the Phaser.Mouse.start method adds the following event listeners:

window.addEventListener('mouseup', this._onMouseUpGlobal, true);
window.addEventListener('mouseout', this._onMouseOutGlobal, true);

Looking at the Phaser.Mouse.stop method, I see that only _onMouseUpGlobal is unregistered:

window.removeEventListener('mouseup', this._onMouseUpGlobal, true);

The following line must also be added:

window.removeEventListener('mouseout', this._onMouseOutGlobal, true);
@stoneman1
Copy link
Contributor

Thanks for this :) Did not have the time to figure it out yet :)

@photonstorm
Copy link
Collaborator

Merged into dev.

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

No branches or pull requests

3 participants