-
Notifications
You must be signed in to change notification settings - Fork 302
-
Notifications
You must be signed in to change notification settings - Fork 302
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
Assertion failure in EventDispatcher::TriggerEvents #45
Comments
In this particular case, a button click event hides the document which triggers another event, in which a listener de-attaches itself right in the ProcessEvent call and that confuses the iterator. |
Changing the loop to read:
fixes the assertion failure :) |
Yeah, I think the problem is that when adding or removing listeners, the iterators will be invalidated. Could you test the changes I committed? |
I think the best solution here would be to copy the slice of the original array to a temporary array and iterate over that. |
…ether event is propagating between each dispatch.
Okay, I guess I'm fine with the approach, at least until I see any real-world problems with it :) |
The following line produces an assertion failure in debug build in MSVC:
Further down the stack:
The _Mycont pointer is null
The text was updated successfully, but these errors were encountered: