Kaydet (Commit) 692c886f authored tarafından Bjoern Michaelsen's avatar Bjoern Michaelsen

remove the weak_ptrs on destruction too

Change-Id: I65f5867c41417539a70eef15754988d9931394a4
üst 1ef03cad
......@@ -23,6 +23,7 @@
#include <swtable.hxx>
#include <docary.hxx>
#include <rootfrm.hxx>
#include <calbck.hxx>
IMPL_FIXEDMEMPOOL_NEWDEL( SwUnoCrsr )
......@@ -39,7 +40,13 @@ SwUnoCrsr::~SwUnoCrsr()
SwDoc* pDoc = GetDoc();
if( !pDoc->IsInDtor() )
{
//assert(!SwIterator<SwClient,SwUnoCrsr>(this).First());
#ifdef DBG_UTIL
SwIterator<SwClient, SwUnoCrsr> pClient(*this);
assert(!pClient.First());
#endif
// remove the weak_ptr the document keeps to notify about document death
pDoc->mvUnoCrsrTbl.remove_if(
[this](const std::weak_ptr<SwUnoCrsr>& pWeakPtr) -> bool { return pWeakPtr.lock().get() == this; });
}
// delete the whole ring
......
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