diff options
author | Noel Grandin <noelgrandin@collabora.co.uk> | 2023-04-12 13:40:08 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-04-12 15:47:03 +0200 |
commit | 9cfa99594cc21ad42f3428c4e2c521dd87511fc2 (patch) | |
tree | fced54888ccabe4ea676788fa44e13a327f6ee39 /vcl/win | |
parent | a925476352b3cb32f6384e7b0fb07e323bb6e64f (diff) |
use more unique_ptr in SalData
Change-Id: Ib6e5131bff38b55b2dbf0805b63ca3554c5ee349
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150278
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/gdi/salgdi.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/vcl/win/gdi/salgdi.cxx b/vcl/win/gdi/salgdi.cxx index 630933192687..8a38a684ca35 100644 --- a/vcl/win/gdi/salgdi.cxx +++ b/vcl/win/gdi/salgdi.cxx @@ -180,9 +180,9 @@ void ImplInitSalGDI() pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, sizeof( BITMAPINFOHEADER ) + 192 ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new tools::Long[ 256 ]; - pSalData->mpDitherLow = new BYTE[ 256 ]; - pSalData->mpDitherHigh = new BYTE[ 256 ]; + pSalData->mpDitherDiff.reset(new tools::Long[ 256 ]); + pSalData->mpDitherLow.reset(new BYTE[ 256 ]); + pSalData->mpDitherHigh.reset(new BYTE[ 256 ]); pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ); memset( pSalData->mpDitherDIB, 0, sizeof( BITMAPINFOHEADER ) ); @@ -254,9 +254,9 @@ void ImplInitSalGDI() pSalData->mhDitherDIB = GlobalAlloc( GMEM_FIXED, nSize ); pSalData->mpDitherDIB = static_cast<BYTE*>(GlobalLock( pSalData->mhDitherDIB )); - pSalData->mpDitherDiff = new tools::Long[ 256 ]; - pSalData->mpDitherLow = new BYTE[ 256 ]; - pSalData->mpDitherHigh = new BYTE[ 256 ]; + pSalData->mpDitherDiff.reset(new tools::Long[ 256 ]); + pSalData->mpDitherLow.reset(new BYTE[ 256 ]); + pSalData->mpDitherHigh.reset(new BYTE[ 256 ]); pSalData->mpDitherDIBData = pSalData->mpDitherDIB + sizeof( BITMAPINFOHEADER ) + ( 256 * sizeof( short ) ); memset( pSalData->mpDitherDIB, 0, sizeof( BITMAPINFOHEADER ) ); @@ -333,9 +333,9 @@ void ImplFreeSalGDI() GlobalUnlock( pSalData->mhDitherDIB ); GlobalFree( pSalData->mhDitherDIB ); pSalData->mhDitherDIB = nullptr; - delete[] pSalData->mpDitherDiff; - delete[] pSalData->mpDitherLow; - delete[] pSalData->mpDitherHigh; + pSalData->mpDitherDiff.reset(); + pSalData->mpDitherLow.reset(); + pSalData->mpDitherHigh.reset(); } DeleteSysColorList(); |