Fixed #12845 adding a listener to an event that is currently being dispatched will not result into a fatal error in TraceableEventDispatcher [EventDispatcher]
bug #12848 [EventDispatcher] Fixed #12845 adding a listener to an event that is currently being dispatched (Pieter Jordaan)

This PR was merged into the 2.5 branch.

Discussion
----------

[EventDispatcher] Fixed #12845 adding a listener to an event that is currently being dispatched

[EventDispatcher] Fixed adding listener when event is currently being dispatched

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12845
| License       | MIT

Commits
-------

0cbc2b0 Fixed #12845 adding a listener to an event that is currently being dispatched will not result into a fatal error in TraceableEventDispatcher [EventDispatcher]