fix memory leak in detective sdr objects
The SdrObject ownership needs to be transferred from the SdrObjList to
the Undo object. Only SdrUndoDelObj takes ownership of the object
SdrUndoRemoveObj does not.
Change-Id: I28f9c538eb4e54ec89ada8521f63d2f49d47a1ff
Reviewed-on: https://gerrit.libreoffice.org/23172
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index ffce77a..7e58c7b 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -689,7 +689,7 @@ void ScDetectiveFunc::DeleteArrowsAt( SCCOL nCol, SCROW nRow, bool bDestPnt )
}
for (size_t i=1; i<=nDelCount; ++i)
pModel->AddCalcUndo( new SdrUndoRemoveObj( *ppObj[nDelCount-i] ) );
pModel->AddCalcUndo( new SdrUndoDelObj( *ppObj[nDelCount-i] ) );
for (size_t i=1; i<=nDelCount; ++i)
pPage->RemoveObject( ppObj[nDelCount-i]->GetOrdNum() );