diff options
author | Michael Meeks <michael.meeks@suse.com> | 2012-07-23 14:53:27 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2012-07-23 14:54:16 +0100 |
commit | d5bbd67f675be962e294c24ee8b6ecccd1f341e8 (patch) | |
tree | d54b0512ba1712583dc8c8f42a27662be2727db1 /vcl | |
parent | 2ca73bfbf46332bcd52619e2e82e6a2a744eaa8c (diff) |
fdo#47368 - fix one potential re-enterancy hazard around even emission
Change-Id: I8be50fb82d1333731dae825b1785e981fe69adbd
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/app/vclevent.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx index 613a659368d4..2656c152e6ab 100644 --- a/vcl/source/app/vclevent.cxx +++ b/vcl/source/app/vclevent.cxx @@ -69,7 +69,10 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const ImplDelData aDel( pWinEvent->GetWindow() ); while ( aIter != aCopy.end() && ! aDel.IsDead() ) { - (*aIter).Call( pEvent ); + Link &rLink = *aIter; + // check this hasn't been removed in some re-enterancy scenario fdo#47368 + if( std::find(m_aListeners.begin(), m_aListeners.end(), rLink) != m_aListeners.end() ) + rLink.Call( pEvent ); aIter++; } } @@ -77,7 +80,9 @@ void VclEventListeners::Call( VclSimpleEvent* pEvent ) const { while ( aIter != aCopy.end() ) { - (*aIter).Call( pEvent ); + Link &rLink = *aIter; + if( std::find(m_aListeners.begin(), m_aListeners.end(), rLink) != m_aListeners.end() ) + rLink.Call( pEvent ); aIter++; } } |