Skip to content

Conversation

spamdaemon
Copy link

This patch fixes a problem with a dangling event listener, which is
called even after it has been removed. This situation can occur when a
listener is removed during an even dispatch.

To fix this problem, the old action is replaced with a NOOP, so that
when the listener is being fired, it is not the old listener but the
NOOP.

This patch fixes a problem with a dangling  event listener, which is
called even after it has been removed. This situation can occur when a
listener is removed during an even dispatch.

To fix this problem, the old action is replaced with a NOOP, so that
when the listener is being fired, it is not the old listener but the
NOOP.
obj.fireEvent('test');
expect(spy.called).to.be(false);
});

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a minor whitespace problem here (mixed tabs and spaces), otherwise looks good!

mourner added a commit that referenced this pull request May 8, 2013
Make sure events don't fire after listener is removed.
@mourner mourner merged commit d58a237 into Leaflet:master May 8, 2013
mourner added a commit that referenced this pull request May 8, 2013
@mourner
Copy link
Member

mourner commented May 8, 2013

Sorry confusion and thanks a lot for the fix, Raimund!

@spamdaemon spamdaemon deleted the FIX_1654 branch May 8, 2013 11:37
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.

2 participants