From 7f3bd017e12bbf1d020423dc2a8618a8b4b05698 Mon Sep 17 00:00:00 2001 From: Tino Rachui Date: Fri, 30 Nov 2001 10:47:58 +0000 Subject: #95423#removed unnecessary locking of rBHelper mutex which may leed to deadlocks in run method --- .../source/win32/filepicker/asynceventnotifier.cxx | 49 ++++++++++------------ 1 file changed, 22 insertions(+), 27 deletions(-) (limited to 'fpicker') diff --git a/fpicker/source/win32/filepicker/asynceventnotifier.cxx b/fpicker/source/win32/filepicker/asynceventnotifier.cxx index 86a4a3d68ee7..65f93838a8ac 100644 --- a/fpicker/source/win32/filepicker/asynceventnotifier.cxx +++ b/fpicker/source/win32/filepicker/asynceventnotifier.cxx @@ -2,9 +2,9 @@ * * $RCSfile: asynceventnotifier.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: tra $ $Date: 2001-11-15 16:00:57 $ + * last change: $Author: tra $ $Date: 2001-11-30 11:47:58 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -149,39 +149,34 @@ void SAL_CALL CAsyncFilePickerEventNotifier::run( ) if ( !m_rBroadcastHelper.bDisposed ) { - ::osl::MutexGuard aGuard( m_rBroadcastHelper.rMutex ); - - if ( !m_rBroadcastHelper.bDisposed ) + while ( m_FilePickerEventList.size() > 0 ) { - while ( m_FilePickerEventList.size() > 0 ) - { - ClearableMutexGuard aGuard( m_FilePickerEventListMutex ); + ClearableMutexGuard aGuard( m_FilePickerEventListMutex ); + + FilePickerEventRecord_t nextEventRecord = m_FilePickerEventList.front(); + m_FilePickerEventList.pop_front(); - FilePickerEventRecord_t nextEventRecord = m_FilePickerEventList.front(); - m_FilePickerEventList.pop_front(); + aGuard.clear(); - aGuard.clear(); + ::cppu::OInterfaceContainerHelper* pICHelper = + m_rBroadcastHelper.aLC.getContainer(getCppuType((Reference*)0) ); - ::cppu::OInterfaceContainerHelper* pICHelper = - m_rBroadcastHelper.aLC.getContainer(getCppuType((Reference*)0) ); + if ( pICHelper ) + { + ::cppu::OInterfaceIteratorHelper iter( *pICHelper ); - if ( pICHelper ) + while( iter.hasMoreElements() ) { - ::cppu::OInterfaceIteratorHelper iter( *pICHelper ); + Reference< XFilePickerListener > xFPListener( iter.next( ), ::com::sun::star::uno::UNO_QUERY ); - while( iter.hasMoreElements() ) + try + { + if ( xFPListener.is() ) + (xFPListener.get()->*nextEventRecord.first)(nextEventRecord.second); + } + catch( RuntimeException& ) { - Reference< XFilePickerListener > xFPListener( iter.next( ), ::com::sun::star::uno::UNO_QUERY ); - - try - { - if ( xFPListener.is() ) - (xFPListener.get()->*nextEventRecord.first)(nextEventRecord.second); - } - catch( RuntimeException& ) - { - OSL_ENSURE( sal_False, "RuntimeException during event dispatching" ); - } + OSL_ENSURE( sal_False, "RuntimeException during event dispatching" ); } } } -- cgit