Use wxDELETE() and wxDELETEA() when possible.
Use wxDELETE[A]() functions which automatically NULL out their arguments after deleting them instead of doing it manually. Closes #9685. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64656 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user