From d5bbd67f675be962e294c24ee8b6ecccd1f341e8 Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Mon, 23 Jul 2012 14:53:27 +0100 Subject: fdo#47368 - fix one potential re-enterancy hazard around even emission Change-Id: I8be50fb82d1333731dae825b1785e981fe69adbd --- vcl/source/app/vclevent.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'vcl') 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++; } } -- cgit v1.2.3