Fix some 'delete' warnings

This commit is contained in:
Pavel Krajcevski 2016-12-24 17:55:20 -05:00
parent ac30691553
commit adcea1bddc
3 changed files with 4 additions and 4 deletions

View file

@ -506,7 +506,7 @@ double Image<PixelType>::ComputeEntropy() {
template<typename PixelType> template<typename PixelType>
void Image<PixelType>::SetImageData(uint32 width, uint32 height, PixelType *data) { void Image<PixelType>::SetImageData(uint32 width, uint32 height, PixelType *data) {
if(m_Pixels) { if(m_Pixels) {
delete m_Pixels; delete [] m_Pixels;
} }
if(!data) { if(!data) {

View file

@ -48,7 +48,7 @@ class ImageWriter {
public: public:
virtual ~ImageWriter() { virtual ~ImageWriter() {
if(m_RawFileData) { if(m_RawFileData) {
delete m_RawFileData; delete [] m_RawFileData;
m_RawFileData = 0; m_RawFileData = 0;
} }
} }

View file

@ -67,7 +67,7 @@ Image &Image::operator=(const Image &other) {
FasTC::Image<FasTC::Pixel>::operator=(other); FasTC::Image<FasTC::Pixel>::operator=(other);
assert(m_FractionalPixels); assert(m_FractionalPixels);
delete m_FractionalPixels; delete [] m_FractionalPixels;
m_FractionalPixels = new FasTC::Pixel[other.GetWidth() * other.GetHeight()]; m_FractionalPixels = new FasTC::Pixel[other.GetWidth() * other.GetHeight()];
memcpy(m_FractionalPixels, other.m_FractionalPixels, memcpy(m_FractionalPixels, other.m_FractionalPixels,
GetWidth() * GetHeight() * sizeof(FasTC::Pixel)); GetWidth() * GetHeight() * sizeof(FasTC::Pixel));
@ -105,7 +105,7 @@ void Image::BilinearUpscale(uint32 xtimes, uint32 ytimes,
FasTC::Pixel *upscaledPixels = new FasTC::Pixel[newWidth * newHeight]; FasTC::Pixel *upscaledPixels = new FasTC::Pixel[newWidth * newHeight];
assert(m_FractionalPixels); assert(m_FractionalPixels);
delete m_FractionalPixels; delete [] m_FractionalPixels;
m_FractionalPixels = new FasTC::Pixel[newWidth * newHeight]; m_FractionalPixels = new FasTC::Pixel[newWidth * newHeight];
Indexer idxr(newWidth, newHeight, wrapMode); Indexer idxr(newWidth, newHeight, wrapMode);