Skip to content
Snippets Groups Projects
Commit f7ff71bd authored by Horst Schirmeier's avatar Horst Schirmeier
Browse files

Revert "ListenerManager bugfix (segfault): [...]"

This commit *introduced* a segfault to the nanojpeg experiment.  Indeed there is
no point in clearing m_FireList here:

 1. Multiple active listeners match an event coming from the simulator.  These
    listeners are moved from their queue to m_FireList.
 2. In a loop iterating over m_FireList, one of the listeners is triggered
    (ListenerManager::triggerActiveListeners()).  Context switches to an
    experiment.  The experiment explicitly (or implicitly, e.g., by terminating)
    calls simulator.clearListeners().
 3. ListenerManager::remove() clears all active (but not currently fired, or
    about to be fired) listeners from the main listener queue (and additionally
    all type-specific special containers).  To prevent the "about to be fired"
    listeners to fire, they are copied to m_DeleteList.
 4. The loop mentioned in 2. does not trigger any listener mentioned in
    m_DeleteList.  Afterwards, m_FireList (and m_DeleteList) is cleared.

Clearing m_FireList in step 3 invalidates the iterator used in the loop from
steps 2 and 4.  In fact, this problem was the reason we introduced the
m_DeleteList workaround in the first place.

This reverts commit r1817.

git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1818 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
parent 8588617a
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment