summaryrefslogtreecommitdiff
path: root/basegfx/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-11-10 13:36:34 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-11-11 07:16:20 +0000
commitdb17d3c17c40d6b0e92392cf3c6e343d1d17b771 (patch)
tree9d562fcf764e7717df9585ef0e735a12ea4aaa16 /basegfx/source
parent2ce9e4be4a438203382cb9cca824ce3e90647f3a (diff)
new loplugin: memoryvar
detect when we can convert a new/delete sequence on a local variable to use std::unique_ptr Change-Id: Iecae4e4197eccdfacfce2eed39aa4a69e4a660bc Reviewed-on: https://gerrit.libreoffice.org/19884 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'basegfx/source')
-rw-r--r--basegfx/source/polygon/b2dpolygoncutandtouch.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
index 0ccebe9fb38d..71804b3fe970 100644
--- a/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
+++ b/basegfx/source/polygon/b2dpolygoncutandtouch.cxx
@@ -29,6 +29,7 @@
#include <vector>
#include <algorithm>
+#include <memory>
#define SUBDIVIDE_FOR_CUT_TEST_COUNT (50)
@@ -887,7 +888,7 @@ namespace basegfx
else
{
// first solve self cuts and self touches for all contained single polygons
- temporaryPolygonData *pTempData = new temporaryPolygonData[nCount];
+ std::unique_ptr<temporaryPolygonData[]> pTempData(new temporaryPolygonData[nCount]);
sal_uInt32 a, b;
for(a = 0L; a < nCount; a++)
@@ -934,8 +935,6 @@ namespace basegfx
{
aRetval.append(mergeTemporaryPointsAndPolygon(pTempData[a].getPolygon(), pTempData[a].getTemporaryPointVector()));
}
-
- delete[] pTempData;
}
return aRetval;