Width = width; Height = height; Depth = depth;
ColorType = (colortype>=0) ? colortype: ((Depth>8) ? COLORTYPE_COLOR: 0);
delete m_palette;
- delete[] RawImage ;
- RawImage = 0;
- m_palette = 0;
+ m_palette = NULL;
+ delete[] RawImage;
+ RawImage = NULL;
- if (lpbi)
- {
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
}
lpbi = wxMacCreateGWorld( Width , Height , Depth);
wxPNGReader::~wxPNGReader ( )
{
- delete[] RawImage ;
- if (lpbi) {
+ if (RawImage != NULL) {
+ delete[] RawImage ;
+ RawImage = NULL;
+ }
+ if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
- }
- delete m_palette;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
+ }
}
{
if (lpbi) {
wxMacDestroyGWorld( (GWorldPtr) lpbi ) ;
+ lpbi = NULL;
+ }
+ if (m_palette != NULL) {
+ delete m_palette;
+ m_palette = NULL;
}
- delete m_palette;
- lpbi = NULL;
- m_palette = NULL;
}
wxBitmap* wxPNGReader::GetBitmap(void)
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
/* set error handling */
{
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
{
if ( pixel_depth == 8 )
{
- for ( int i = 0 ; i < info_ptr->width ; ++i )
+ for ( size_t i = 0 ; i < info_ptr->width ; ++i )
{
png_color_struct* color ;
RGBColor col ;
}
else
{
- for ( int i = 0 ; i < info_ptr->width ; ++i )
+ for ( size_t i = 0 ; i < info_ptr->width ; ++i )
{
png_color_struct* color ;
RGBColor col ;
}
else
{
- for ( int i = 0 ; i < info_ptr->width ; ++i )
+ for ( size_t i = 0 ; i < info_ptr->width ; ++i )
{
png_color_struct* color ;
RGBColor col ;
png_read_destroy(png_ptr, info_ptr, (png_info *)0);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);
if (!info_ptr)
{
fclose(fp);
- delete(png_ptr);
+ delete png_ptr;
return FALSE;
}
{
png_write_destroy(png_ptr);
fclose(fp);
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* If we get here, we had a problem reading the file */
return FALSE;
delete[] (info_ptr->palette);
/* free the structures */
- delete(png_ptr);
- delete(info_ptr);
+ delete png_ptr;
+ delete info_ptr;
/* close the file */
fclose(fp);