diff options
author | Michael Stahl <mstahl@redhat.com> | 2011-10-24 12:58:23 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2011-10-24 15:27:32 +0200 |
commit | 3895c2e7c8b32bfde74e2dc391c6c195aae22fc7 (patch) | |
tree | 5940735ebd3c092d2d24b0275ea6650f4fec4fc7 /forms | |
parent | dc8249af103741415a074d9bbf8b1211f24a7c3f (diff) |
fdo#42157: fix deadlock
WindowStateGuard_Impl::impl_ensureEnabledState_nothrow_nolck:
drop own mutex while calling XWindow method that locks SolarMutex.
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/helper/windowstateguard.cxx | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/forms/source/helper/windowstateguard.cxx b/forms/source/helper/windowstateguard.cxx index 7a947ecf30fb..2cfae615f4de 100644 --- a/forms/source/helper/windowstateguard.cxx +++ b/forms/source/helper/windowstateguard.cxx @@ -135,18 +135,21 @@ namespace frm try { Reference< XWindow2 > xWindow; - sal_Bool bEnabled = sal_False; + Reference< XPropertySet > xModelProps; sal_Bool bShouldBeEnabled = sal_False; { ::osl::MutexGuard aGuard( m_aMutex ); if ( !m_xWindow.is() || !m_xModelProps.is() ) return; xWindow = m_xWindow; - bEnabled = xWindow->isEnabled(); - OSL_VERIFY( m_xModelProps->getPropertyValue( PROPERTY_ENABLED ) >>= bShouldBeEnabled ); + xModelProps = m_xModelProps; } + // fdo#42157: do not lock m_aMutex to prevent deadlock + bool const bEnabled = xWindow->isEnabled(); + OSL_VERIFY( xModelProps->getPropertyValue( PROPERTY_ENABLED ) + >>= bShouldBeEnabled ); - if ( !bShouldBeEnabled && bEnabled && xWindow.is() ) + if ( !bShouldBeEnabled && bEnabled ) xWindow->setEnable( sal_False ); } catch( const Exception& ) |