diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-26 09:41:14 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 08:42:36 +0200 |
commit | 513ac8eb79e45de332d7ddab5b27c70578b904f1 (patch) | |
tree | 46f35b236d75651eb612a088e2cdfd48aa85a21c /sot | |
parent | 72b706d7def9e4805e35f3174170dad422b2e7f8 (diff) |
loplugin:useuniqueptr in various
extending it to find places we can use std::unique_ptr on arrays
Change-Id: I9feb1d12d738d6931e752ecb6dd51cbc1540c81b
Reviewed-on: https://gerrit.libreoffice.org/39255
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r-- | sot/source/sdstor/stgio.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sot/source/sdstor/stgio.cxx b/sot/source/sdstor/stgio.cxx index 1ac21705ad03..a464ed1a06b9 100644 --- a/sot/source/sdstor/stgio.cxx +++ b/sot/source/sdstor/stgio.cxx @@ -145,14 +145,13 @@ bool StgIo::CommitAll() class EasyFat { - sal_Int32 *pFat; - bool *pFree; + std::unique_ptr<sal_Int32[]> pFat; + std::unique_ptr<bool[]> pFree; sal_Int32 nPages; sal_Int32 nPageSize; public: EasyFat( StgIo & rIo, StgStrm *pFatStream, sal_Int32 nPSize ); - ~EasyFat() { delete[] pFat; delete[] pFree; } sal_Int32 GetPageSize() { return nPageSize; } @@ -164,8 +163,8 @@ EasyFat::EasyFat( StgIo& rIo, StgStrm* pFatStream, sal_Int32 nPSize ) { nPages = pFatStream->GetSize() >> 2; nPageSize = nPSize; - pFat = new sal_Int32[ nPages ]; - pFree = new bool[ nPages ]; + pFat.reset( new sal_Int32[ nPages ] ); + pFree.reset( new bool[ nPages ] ); rtl::Reference< StgPage > pPage; sal_Int32 nFatPageSize = (1 << rIo.m_aHdr.GetPageSize()) - 2; |