summaryrefslogtreecommitdiff
path: root/sw/source/core/attr
diff options
context:
space:
mode:
authorBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-09 18:56:17 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2015-11-09 19:04:32 +0100
commitffdc5db260b7c17c47109f707b3664a3f3caafaa (patch)
treeef804335eb959645b118f506360b89e78d7e0370 /sw/source/core/attr
parent37039fde1187c2e71bdde6e7fafd23c6ae8a871e (diff)
fix a set of race conditions in the writer uno wrappers
- whenever SwClients are added or removed, the SolarMutex should be locked - locking the mutex there would be a performance killer - thus only DBG_TESTSOLARMUTEX() and fixing the fallout on DBG_UTL builds Change-Id: I3b10b9a01c40fbe68d15ce6e9c5c74db34eb1eb6 Reviewed-on: https://gerrit.libreoffice.org/19856
Diffstat (limited to 'sw/source/core/attr')
-rw-r--r--sw/source/core/attr/calbck.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/sw/source/core/attr/calbck.cxx b/sw/source/core/attr/calbck.cxx
index fafb9a6a1b49..0ba6a74558e2 100644
--- a/sw/source/core/attr/calbck.cxx
+++ b/sw/source/core/attr/calbck.cxx
@@ -22,6 +22,7 @@
#include <hints.hxx>
#include <swcache.hxx>
#include <swfntcch.hxx>
+#include <tools/debug.hxx>
sw::LegacyModifyHint::~LegacyModifyHint() {}
@@ -29,6 +30,8 @@ TYPEINIT0( SwClient );
SwClient::~SwClient()
{
+ if(GetRegisteredIn())
+ DBG_TESTSOLARMUTEX();
OSL_ENSURE( !pRegisteredIn || pRegisteredIn->HasWriterListeners(), "SwModify still known, but Client already disconnected!" );
if( pRegisteredIn && pRegisteredIn->HasWriterListeners() )
pRegisteredIn->Remove( this );
@@ -36,6 +39,7 @@ SwClient::~SwClient()
void SwClient::CheckRegistration( const SfxPoolItem* pOld, const SfxPoolItem* )
{
+ DBG_TESTSOLARMUTEX();
// this method only handles notification about dying SwModify objects
if( (!pOld || pOld->Which() != RES_OBJECTDYING) )
return;
@@ -73,6 +77,7 @@ void SwClient::Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const
SwModify::~SwModify()
{
+ DBG_TESTSOLARMUTEX();
OSL_ENSURE( !IsModifyLocked(), "Modify destroyed but locked." );
if ( IsInCache() )
@@ -109,6 +114,7 @@ SwModify::~SwModify()
void SwModify::NotifyClients( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewValue )
{
+ DBG_TESTSOLARMUTEX();
if ( IsInCache() || IsInSwFntCache() )
{
const sal_uInt16 nWhich = pOldValue ? pOldValue->Which() :
@@ -158,6 +164,7 @@ bool SwModify::GetInfo( SfxPoolItem& rInfo ) const
void SwModify::Add( SwClient* pDepend )
{
+ DBG_TESTSOLARMUTEX();
OSL_ENSURE( !m_bLockClientList, "Client inserted while in Modify" );
if(pDepend->pRegisteredIn != this )
@@ -202,6 +209,7 @@ SwClient* SwModify::Remove( SwClient* pDepend )
if(m_bInDocDTOR)
return nullptr;
+ DBG_TESTSOLARMUTEX();
assert(pDepend->pRegisteredIn == this);
// SwClient is my listener