fix free of GC-allocated data forom XPM read
svn: r5756
This commit is contained in:
parent
a67b249c36
commit
cd3fe00778
|
@ -186,7 +186,6 @@ wxBitmap::wxBitmap(char **data, wxItem *WXUNUSED(anItem)) // anItem used for MOT
|
||||||
} else {
|
} else {
|
||||||
// create failed: free all memory
|
// create failed: free all memory
|
||||||
XpmFreeAttributes(Xbitmap->xpm);
|
XpmFreeAttributes(Xbitmap->xpm);
|
||||||
DELETE_VAL Xbitmap->xpm;
|
|
||||||
DELETE_OBJ Xbitmap;
|
DELETE_OBJ Xbitmap;
|
||||||
Xbitmap = NULL;
|
Xbitmap = NULL;
|
||||||
}
|
}
|
||||||
|
@ -295,7 +294,6 @@ void wxBitmap::Destroy(void)
|
||||||
cm = *((Colormap*)(cmap->GetHandle()));
|
cm = *((Colormap*)(cmap->GetHandle()));
|
||||||
XFreeColors(wxAPP_DISPLAY, cm, Xbitmap->xpm->pixels, Xbitmap->xpm->npixels, 0);
|
XFreeColors(wxAPP_DISPLAY, cm, Xbitmap->xpm->pixels, Xbitmap->xpm->npixels, 0);
|
||||||
XpmFreeAttributes(Xbitmap->xpm);
|
XpmFreeAttributes(Xbitmap->xpm);
|
||||||
DELETE_VAL Xbitmap->xpm;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -392,7 +390,6 @@ else if (flags & wxBITMAP_TYPE_XPM) { // XPM file format
|
||||||
} else {
|
} else {
|
||||||
// read failed: free all memory
|
// read failed: free all memory
|
||||||
XpmFreeAttributes(Xbitmap->xpm);
|
XpmFreeAttributes(Xbitmap->xpm);
|
||||||
DELETE_VAL Xbitmap->xpm;
|
|
||||||
DELETE_OBJ Xbitmap;
|
DELETE_OBJ Xbitmap;
|
||||||
Xbitmap = NULL;
|
Xbitmap = NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user