X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/33ac7e6f01acbac1cff0ad400d8ea7f0bfd0a62f..25db1b74f1264c27bbf2e5fcc9f3a19ccc56d5fc:/src/common/imagpcx.cpp diff --git a/src/common/imagpcx.cpp b/src/common/imagpcx.cpp index 846130b687..17a9b54bd5 100644 --- a/src/common/imagpcx.cpp +++ b/src/common/imagpcx.cpp @@ -277,9 +277,10 @@ int ReadPCX(wxImage *image, wxInputStream& stream) *(p++) = pal[3 * index + 2]; } - unsigned char* r = new unsigned char[256]; - unsigned char* g = new unsigned char[256]; - unsigned char* b = new unsigned char[256]; +#if wxUSE_PALETTE + unsigned char r[256]; + unsigned char g[256]; + unsigned char b[256]; for (i = 0; i < 256; i++) { r[i] = pal[3*i + 0]; @@ -287,7 +288,7 @@ int ReadPCX(wxImage *image, wxInputStream& stream) b[i] = pal[3*i + 2]; } image->SetPalette(wxPalette(256, r, g, b)); - delete[] r; delete[] g; delete[] b; +#endif // wxUSE_PALETTE } return wxPCX_OK;