diff --git a/vcl/source/outdev/transparent.cxx b/vcl/source/outdev/transparent.cxx index 49c8bfa23e07..3d37b8fe47ba 100644 --- a/vcl/source/outdev/transparent.cxx +++ b/vcl/source/outdev/transparent.cxx @@ -421,7 +421,8 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, { const BitmapPalette& rPal = pW->GetPalette(); const sal_uInt16 nCount = rPal.GetEntryCount(); - BitmapColor* pMap = reinterpret_cast(new sal_uInt8[ nCount * sizeof( BitmapColor ) ]); + std::unique_ptr xMap(new sal_uInt8[ nCount * sizeof( BitmapColor )]); + BitmapColor* pMap = reinterpret_cast(xMap.get()); for( sal_uInt16 i = 0; i < nCount; i++ ) { @@ -470,7 +471,6 @@ void OutputDevice::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, } } } - delete[] reinterpret_cast(pMap); } else {