diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 613a659..5a6fb7c 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -69,7 +69,13 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const ImplDelData aDel( pWinEvent->GetWindow() ); while ( aIter != aCopy.end() && ! aDel.IsDead() ) { - (*aIter).Call( pEvent ); + Link &rLink = *aIter; + if( std::find(m_aListeners.begin(), m_aListeners.end(), rLink) != m_aListeners.end() ) + { // listener removed while we're iterating + fprintf (stderr, "Bang - we would have died\n"); + } else { + rLink.Call( pEvent ); + } aIter++; } }