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

Fix for problem with unbinding events inside cb #30

Merged
merged 1 commit into from Feb 8, 2013

Conversation

Projects
None yet
2 participants
@wellcaffeinated
Contributor

wellcaffeinated commented Feb 7, 2013

When doing something like this:
.on('evt', function theCallback(data){
    this.off('evt', theCallback);
});

stapes will throw an error because the event handler array
is being modified as it is looping though.

This edit copies the array locally to fix this.

Fix for problem with unbinding events inside cb
When doing something like this:
.on('evt', function theCallback(data){
    this.off('evt', theCallback);
});

stapes will throw an error because the event handler array 
is being modified as it is looping though.

This edit copies the array locally to fix this.

hay added a commit that referenced this pull request Feb 8, 2013

Merge pull request #30 from wellcaffeinated/patch-2
Fix for problem with unbinding events inside cb

@hay hay merged commit 0a9c480 into hay:master Feb 8, 2013

@hay

This comment has been minimized.

Show comment
Hide comment
@hay

hay Feb 8, 2013

Owner

Merged and will be in the next release. I've optimized the code a little bit (slice.call is cached). Thanks again for a patch Jasper!

Owner

hay commented Feb 8, 2013

Merged and will be in the next release. I've optimized the code a little bit (slice.call is cached). Thanks again for a patch Jasper!

hay added a commit that referenced this pull request Feb 8, 2013

@wellcaffeinated

This comment has been minimized.

Show comment
Hide comment
@wellcaffeinated

wellcaffeinated Feb 8, 2013

Contributor

Good call. (pun intended)

Contributor

wellcaffeinated commented Feb 8, 2013

Good call. (pun intended)

@hay

This comment has been minimized.

Show comment
Hide comment
@hay

hay Feb 9, 2013

Owner

Lol.

Owner

hay commented Feb 9, 2013

Lol.

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