summaryrefslogtreecommitdiff
path: root/svx/source/svdraw/svdmodel.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-12-12 15:11:48 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-13 11:32:56 +0100
commitb586bfcff288151082f7d247b392c5640ae5c951 (patch)
treecf87d67397c5c53469ca350f12b0b40e1660efdf /svx/source/svdraw/svdmodel.cxx
parente71f44f4dc847c75b874d514888d0675ccb00496 (diff)
use unique_ptr in checkForUniqueItem
fixing a memory leak in chart2 Change-Id: Idddb6a46b1bde5c1a11148c03bbdaac20ac78e13 Reviewed-on: https://gerrit.libreoffice.org/65031 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/svdraw/svdmodel.cxx')
-rw-r--r--svx/source/svdraw/svdmodel.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index f9b7b8d08c2b..72b947ffb80d 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -1748,7 +1748,7 @@ void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSe
{
if(SfxItemState::SET == pSourceSet->GetItemState(nWhich, false, &pPoolItem))
{
- const SfxPoolItem* pResultItem = nullptr;
+ std::unique_ptr<SfxPoolItem> pResultItem;
switch( nWhich )
{
@@ -1780,7 +1780,7 @@ void SdrModel::MigrateItemSet( const SfxItemSet* pSourceSet, SfxItemSet* pDestSe
if( pResultItem )
{
pDestSet->Put(*pResultItem);
- delete pResultItem;
+ pResultItem.reset();
}
else
pDestSet->Put(*pPoolItem);