Kaydet (Commit) 938cd22a authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

remove b_mInDocDTOR flag altogether

Change-Id: I09ca56854f23fe1fc452648042990bee29082f88
üst f93a2e53
......@@ -149,7 +149,6 @@ class SW_DLLPUBLIC SwModify: public SwClient
sw::WriterListener* m_pWriterListeners; // the start of the linked list of clients
bool m_bModifyLocked : 1; // don't broadcast changes now
bool m_bLockClientList : 1; // may be set when this instance notifies its clients
bool m_bInDocDTOR : 1; // workaround for problems when a lot of objects are destroyed
bool m_bInCache : 1;
bool m_bInSwFntCache : 1;
......@@ -162,10 +161,10 @@ class SW_DLLPUBLIC SwModify: public SwClient
SwModify &operator =(const SwModify&) = delete;
public:
SwModify()
: SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false)
: SwClient(nullptr), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInCache(false), m_bInSwFntCache(false)
{}
explicit SwModify( SwModify* pToRegisterIn )
: SwClient(pToRegisterIn), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInDocDTOR(false), m_bInCache(false), m_bInSwFntCache(false)
: SwClient(pToRegisterIn), m_pWriterListeners(nullptr), m_bModifyLocked(false), m_bLockClientList(false), m_bInCache(false), m_bInSwFntCache(false)
{}
// broadcasting: send notifications to all clients
......
......@@ -77,13 +77,13 @@ void SwClient::Modify(SfxPoolItem const*const pOldValue, SfxPoolItem const*const
void SwModify::SetInDocDTOR()
{
m_bInDocDTOR = true;
// If the document gets destroyed anyway, just tell clients to
// forget me so that they don't try to get removed from my list
// later when they also get destroyed
SwIterator<SwClient,SwModify> aIter(*this);
for(SwClient* pClient = aIter.First(); pClient; pClient = aIter.Next())
pClient->pRegisteredIn = nullptr;
m_pWriterListeners = nullptr;
}
SwModify::~SwModify()
......@@ -97,8 +97,6 @@ SwModify::~SwModify()
if ( IsInSwFntCache() )
pSwFontCache->Delete( this );
if(m_bInDocDTOR)
return;
// notify all clients that they shall remove themselves
SwPtrMsgPoolItem aDyObject( RES_OBJECTDYING, this );
NotifyClients( &aDyObject, &aDyObject );
......@@ -203,9 +201,6 @@ void SwModify::Add( SwClient* pDepend )
SwClient* SwModify::Remove( SwClient* pDepend )
{
if(m_bInDocDTOR)
return nullptr;
DBG_TESTSOLARMUTEX();
assert(pDepend->pRegisteredIn == this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment