diff options
author | Ulrich Kitzinger <ulrich.kitzinger@muenchen.de> | 2014-02-27 18:15:06 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2014-10-06 10:52:45 +0200 |
commit | 14b159cabd30ad4ccae3b5a814b1c7e95639fdb3 (patch) | |
tree | 3f0fe6663d03be4398cdebd8f2d6f0bbe2f511c1 | |
parent | c129eef2436d233a73acebfa12db8a90c7c262a9 (diff) |
Zugriff auf static Variable synchronisiert (Trac 11400)
Change-Id: I623650afee10cc60b49067f4efbdc889b58007dc
-rw-r--r-- | sw/source/core/attr/calbck.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx index 23226cb67b56..d483b4cfde11 100644 --- a/sw/source/core/attr/calbck.cxx +++ b/sw/source/core/attr/calbck.cxx @@ -24,6 +24,7 @@ #include <swfntcch.hxx> // mba: get rid of that dependency static SwClientIter* pClientIters = 0; +static ::osl::Mutex m_IterMutex; TYPEINIT0( SwClient ); @@ -225,6 +226,7 @@ void SwModify::Add( SwClient* pDepend ) if(pDepend->pRegisteredIn != this ) { #if OSL_DEBUG_LEVEL > 0 + osl::MutexGuard aLock( m_IterMutex ); SwClientIter* pTmp = pClientIters; while( pTmp ) { @@ -280,6 +282,7 @@ SwClient* SwModify::Remove( SwClient* pDepend ) pR->pLeft = pL; // update ClientIters + osl::MutexGuard aLock( m_IterMutex ); SwClientIter* pTmp = pClientIters; while( pTmp ) { @@ -340,6 +343,7 @@ void SwModify::CheckCaching( const sal_uInt16 nWhich ) void SwModify::CallSwClientNotify( const SfxHint& rHint ) const { SwClientIter aIter(*this); + osl::MutexGuard aLock( m_IterMutex ); SwClient* pClient = aIter.GoStart(); while( pClient ) { @@ -351,6 +355,7 @@ void SwModify::CallSwClientNotify( const SfxHint& rHint ) const void SwModify::ModifyBroadcast( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue, TypeId nType ) { SwClientIter aIter( *this ); + osl::MutexGuard aLock( m_IterMutex ); SwClient* pClient = aIter.First( nType ); while( pClient ) { @@ -396,6 +401,7 @@ SwClientIter::SwClientIter( const SwModify& rModify ) : rRoot( rModify ) { pNxtIter = 0; + osl::MutexGuard aLock( m_IterMutex ); if( pClientIters ) { // append to list of ClientIters @@ -415,6 +421,7 @@ SwClientIter::SwClientIter( const SwModify& rModify ) SwClientIter::~SwClientIter() { + osl::MutexGuard aLock( m_IterMutex ); if( pClientIters ) { // reorganize list of ClientIters |