X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..34b239ec5d9c20a78adaa2dd680bd482b43a68f7:/src/common/imagiff.cpp?ds=sidebyside diff --git a/src/common/imagiff.cpp b/src/common/imagiff.cpp index 3dd0f7f392..bf214b15c8 100644 --- a/src/common/imagiff.cpp +++ b/src/common/imagiff.cpp @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: src/common/imagiff.h +// Name: src/common/imagiff.cpp // Purpose: wxImage handler for Amiga IFF images // Author: Steffen Gutmann, Thomas Meyer // RCS-ID: $Id$ @@ -98,10 +98,10 @@ public: // constructor, destructor, etc. wxIFFDecoder(wxInputStream *s); ~wxIFFDecoder() { Destroy(); } - + // NOTE: this function modifies the current stream position bool CanRead(); - + int ReadIFF(); bool ConvertToImage(wxImage *image) const; }; @@ -121,12 +121,9 @@ wxIFFDecoder::wxIFFDecoder(wxInputStream *s) void wxIFFDecoder::Destroy() { - delete m_image; - m_image = 0; - delete [] databuf; - databuf = 0; - delete [] decomp_mem; - decomp_mem = 0; + wxDELETE(m_image); + wxDELETEA(databuf); + wxDELETEA(decomp_mem); } //--------------------------------------------------------------------------- @@ -420,8 +417,7 @@ int wxIFFDecoder::ReadIFF() const byte *cmapptr = dataptr + 8; colors = chunkLen / 3; // calc no of colors - delete m_image->pal; - m_image->pal = 0; + wxDELETE(m_image->pal); m_image->colors = colors; if (colors > 0) { m_image->pal = new byte[3*colors]; @@ -479,8 +475,7 @@ int wxIFFDecoder::ReadIFF() decomprle(bodyptr, decomp_mem, chunkLen, decomp_bufsize); bodyptr = decomp_mem; // -> uncompressed BODY chunkLen = decomp_bufsize; - delete [] databuf; - databuf = 0; + wxDELETEA(databuf); } // the following determines the type of the ILBM file.