diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-11 09:48:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-13 06:49:23 +0000 |
commit | e8b49f09074fe184374bee5062715357427ae044 (patch) | |
tree | b9cf1f5e3d7ab8b98345a512b6ddb0da42fe2919 /vcl/source/gdi/impvect.cxx | |
parent | 5e0e27e758e6f7fa325f36e6e51540e10bab0fdc (diff) |
new loplugin: useuniqueptr: vcl
Change-Id: Idcbc8655108ff57c06c33bbcabd652387bf3c4ec
Reviewed-on: https://gerrit.libreoffice.org/32948
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi/impvect.cxx')
-rw-r--r-- | vcl/source/gdi/impvect.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/vcl/source/gdi/impvect.cxx b/vcl/source/gdi/impvect.cxx index 8891838b7c78..6a88538fb8c0 100644 --- a/vcl/source/gdi/impvect.cxx +++ b/vcl/source/gdi/impvect.cxx @@ -268,7 +268,8 @@ private: Point maStartPt; sal_uLong mnArraySize; sal_uLong mnCount; - sal_uInt8* mpCodes; + std::unique_ptr<sal_uInt8[]> + mpCodes; void ImplGetSpace(); @@ -293,12 +294,11 @@ ImplChain::ImplChain() : mnArraySize ( 1024UL ), mnCount ( 0UL ) { - mpCodes = new sal_uInt8[ mnArraySize ]; + mpCodes.reset( new sal_uInt8[ mnArraySize ] ); } ImplChain::~ImplChain() { - delete[] mpCodes; } void ImplChain::ImplGetSpace() @@ -308,9 +308,8 @@ void ImplChain::ImplGetSpace() mnArraySize = mnArraySize << 1UL; pNewCodes = new sal_uInt8[ mnArraySize ]; - memcpy( pNewCodes, mpCodes, nOldArraySize ); - delete[] mpCodes; - mpCodes = pNewCodes; + memcpy( pNewCodes, mpCodes.get(), nOldArraySize ); + mpCodes.reset( pNewCodes ); } void ImplChain::ImplBeginAdd( const Point& rStartPt ) |