diff options
-rw-r--r-- | svx/source/svdraw/svdobj.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d1d898379fdf..ded90158472b 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -394,18 +394,17 @@ SdrObject::SdrObject(SdrModel& rSdrModel) SdrObject::~SdrObject() { - // tell all the registered ObjectUsers that the page is in destruction - sdr::ObjectUserVector aListCopy(mpImpl->maObjectUsers.begin(), mpImpl->maObjectUsers.end()); - for(sdr::ObjectUser* pObjectUser : aListCopy) + // Tell all the registered ObjectUsers that the page is in destruction. + // And clear the vector. This means that user do not need to call RemoveObjectUser() + // when they get called from ObjectInDestruction(). + sdr::ObjectUserVector aList; + aList.swap(mpImpl->maObjectUsers); + for(sdr::ObjectUser* pObjectUser : aList) { DBG_ASSERT(pObjectUser, "SdrObject::~SdrObject: corrupt ObjectUser list (!)"); pObjectUser->ObjectInDestruction(*this); } - // Clear the vector. This means that user do not need to call RemoveObjectUser() - // when they get called from ObjectInDestruction(). - mpImpl->maObjectUsers.clear(); - // UserCall SendUserCall(SdrUserCallType::Delete, GetLastBoundRect()); o3tl::reset_preserve_ptr_during(pPlusData); |