From d29818290376f10f318ba805a79643384b34986e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 29 Oct 2012 16:22:02 +0100 Subject: fdo#46808: Fix previous commit Removing the xJobExecutor.is() check from SfxGlobalEvents_Impl::implts_notifyJobExecution was wrong, as m_xJobExecutorListener was a WeakReference. However, it appears there is no good reason for the latter, so the situation can be corrected by turning it into a plain Reference. Change-Id: I5690d226b3e8fdd97f75a37502e600b460ec674c --- sfx2/source/notify/eventsupplier.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'sfx2/source/notify') diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx index 625fedbd5cfa..21b578b7146a 100644 --- a/sfx2/source/notify/eventsupplier.cxx +++ b/sfx2/source/notify/eventsupplier.cxx @@ -551,6 +551,7 @@ SFX_IMPL_ONEINSTANCEFACTORY( SfxGlobalEvents_Impl ); //----------------------------------------------------------------------------- SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const css::uno::Reference < css::uno::XComponentContext >& rxContext) : ModelCollectionMutexBase( ) + , m_xJobExecutorListener( css::task::JobExecutor::create( rxContext ), css::uno::UNO_QUERY_THROW ) , m_aLegacyListeners (m_aLock) , m_aDocumentListeners (m_aLock) , pImp (0 ) @@ -559,7 +560,6 @@ SfxGlobalEvents_Impl::SfxGlobalEvents_Impl( const css::uno::Reference < css::uno SFX_APP(); pImp = new GlobalEventConfig(); m_xEvents = pImp; - m_xJobExecutorListener = css::uno::Reference< css::document::XEventListener >( css::task::JobExecutor::create( rxContext ), css::uno::UNO_QUERY_THROW ); m_refCount--; } @@ -784,12 +784,7 @@ void SfxGlobalEvents_Impl::implts_notifyJobExecution(const css::document::EventO { try { - // SAFE -> - ::osl::ResettableMutexGuard aLock(m_aLock); - css::uno::Reference< css::document::XEventListener > xJobExecutor(m_xJobExecutorListener); - aLock.clear(); - // <- SAFE - xJobExecutor->notifyEvent(aEvent); + m_xJobExecutorListener->notifyEvent(aEvent); } catch(const css::uno::RuntimeException&) { throw; } -- cgit