From adcea1bddc6cd6df0f4cea22426f4323fdc8dc84 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Sat, 24 Dec 2016 17:55:20 -0500 Subject: [PATCH] Fix some 'delete' warnings --- Base/src/Image.cpp | 2 +- IO/config/ImageWriter.h.in | 2 +- PVRTCEncoder/src/PVRTCImage.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Base/src/Image.cpp b/Base/src/Image.cpp index bc37989..a82ff26 100644 --- a/Base/src/Image.cpp +++ b/Base/src/Image.cpp @@ -506,7 +506,7 @@ double Image::ComputeEntropy() { template void Image::SetImageData(uint32 width, uint32 height, PixelType *data) { if(m_Pixels) { - delete m_Pixels; + delete [] m_Pixels; } if(!data) { diff --git a/IO/config/ImageWriter.h.in b/IO/config/ImageWriter.h.in index 24a12e9..ecd1135 100644 --- a/IO/config/ImageWriter.h.in +++ b/IO/config/ImageWriter.h.in @@ -48,7 +48,7 @@ class ImageWriter { public: virtual ~ImageWriter() { if(m_RawFileData) { - delete m_RawFileData; + delete [] m_RawFileData; m_RawFileData = 0; } } diff --git a/PVRTCEncoder/src/PVRTCImage.cpp b/PVRTCEncoder/src/PVRTCImage.cpp index 6671ab9..039170f 100644 --- a/PVRTCEncoder/src/PVRTCImage.cpp +++ b/PVRTCEncoder/src/PVRTCImage.cpp @@ -67,7 +67,7 @@ Image &Image::operator=(const Image &other) { FasTC::Image::operator=(other); assert(m_FractionalPixels); - delete m_FractionalPixels; + delete [] m_FractionalPixels; m_FractionalPixels = new FasTC::Pixel[other.GetWidth() * other.GetHeight()]; memcpy(m_FractionalPixels, other.m_FractionalPixels, GetWidth() * GetHeight() * sizeof(FasTC::Pixel)); @@ -105,7 +105,7 @@ void Image::BilinearUpscale(uint32 xtimes, uint32 ytimes, FasTC::Pixel *upscaledPixels = new FasTC::Pixel[newWidth * newHeight]; assert(m_FractionalPixels); - delete m_FractionalPixels; + delete [] m_FractionalPixels; m_FractionalPixels = new FasTC::Pixel[newWidth * newHeight]; Indexer idxr(newWidth, newHeight, wrapMode);