From 561697e7bafe9c4b31340e4c507907f16b03e1fc Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 30 Oct 2009 17:33:01 +0100 Subject: #i93514#: really fix locking for PropertyBag::setModified() --- comphelper/source/property/opropertybag.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'comphelper/source') diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx index 8b816e8c1ce9..caa895021103 100644 --- a/comphelper/source/property/opropertybag.cxx +++ b/comphelper/source/property/opropertybag.cxx @@ -240,7 +240,7 @@ namespace comphelper if ( !( _element >>= aProperty ) ) throw IllegalArgumentException( ::rtl::OUString(), *this, 1 ); - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::ClearableMutexGuard g( m_aMutex ); // check whether the type is allowed, everything else will be checked // by m_aDynamicProperties @@ -254,6 +254,7 @@ namespace comphelper // our property info is dirty m_pArrayHelper.reset(); + g.clear(); setModified(sal_True); } @@ -346,7 +347,7 @@ namespace comphelper //-------------------------------------------------------------------- void SAL_CALL OPropertyBag::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::ClearableMutexGuard g( m_aMutex ); // check whether the type is allowed, everything else will be checked // by m_aDynamicProperties @@ -362,19 +363,21 @@ namespace comphelper // our property info is dirty m_pArrayHelper.reset(); + g.clear(); setModified(sal_True); } //-------------------------------------------------------------------- void SAL_CALL OPropertyBag::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException) { - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::ClearableMutexGuard g( m_aMutex ); m_aDynamicProperties.removeProperty( _rName ); // our property info is dirty m_pArrayHelper.reset(); + g.clear(); setModified(sal_True); } -- cgit