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

removeEventListener() doesn't work with HashLink target #2238

Closed
joshtynjala opened this issue Aug 21, 2019 · 3 comments
Closed

removeEventListener() doesn't work with HashLink target #2238

joshtynjala opened this issue Aug 21, 2019 · 3 comments

Comments

@joshtynjala
Copy link
Member

Code:

var dispatcher = new EventDispatcher();
dispatcher.addEventListener(Event.CHANGE, methodListener);
dispatcher.dispatchEvent(new Event(Event.CHANGE));
dispatcher.removeEventListener(Event.CHANGE, methodListener);
dispatcher.dispatchEvent(new Event(Event.CHANGE));

The listener must be a method on a class (it seems to work correctly with a local function):

private function methodListener(event:Event):Void {
	trace(event.type);
}

Expected output:

change

Actual output:

change
change
@m0rkeulv
Copy link
Member

m0rkeulv commented Sep 9, 2019

As far as i can tell this is a bug in HashLink.
I have made an issue over at the HashLink repo.
HaxeFoundation/hashlink#301

@jgranick
Copy link
Member

jgranick commented Sep 9, 2019

a8605d7

@joshtynjala
Copy link
Member Author

Confirmed fixed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants