svx/source/svdraw/svdobj.cxx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
New commits: commit dd9434929e507e5989bed94bbafe4fe891bf6c22 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Feb 7 09:10:31 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Feb 7 12:36:45 2020 +0100 use swap instead of copy and clear Change-Id: I51aa680e66aa0a5186edadf9d5a2d57798be4103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits