summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2009-10-30 17:33:01 +0100
committerMichael Stahl <mst@openoffice.org>2009-10-30 17:33:01 +0100
commit561697e7bafe9c4b31340e4c507907f16b03e1fc (patch)
tree8220c23d903443003590e09c65877edbcdc0c3fe /comphelper
parentc0f197f920974f3fdaf8278dad16dc5ecb994d52 (diff)
#i93514#: really fix locking for PropertyBag::setModified()
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/property/opropertybag.cxx9
1 files changed, 6 insertions, 3 deletions
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);
}