[Libreoffice-commits] .: Branch 'libreoffice-3-6-0' - vcl/source

Petr Mladek pmladek at kemper.freedesktop.org
Tue Jul 24 01:15:49 PDT 2012


 vcl/source/app/vclevent.cxx |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

New commits:
commit 59205e8d8136eeb5a2648b2fb39d747ebfdb19de
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Mon Jul 23 14:53:27 2012 +0100

    fdo#47368 - fix one potential re-enterancy hazard around even emission
    
    Change-Id: I8be50fb82d1333731dae825b1785e981fe69adbd
    Signed-off-by: Norbert Thiebaud <nthiebaud at gmail.com>
    Signed-off-by: Petr Mladek <pmladek at suse.cz>
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 613a659..2656c15 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++;
         }
     }


More information about the Libreoffice-commits mailing list