XFreePixmap() memory leak with bitmaps
Submitted by neo..@..il.com
Assigned to Xorg Project Team
Description
int main () {
const char* NIL = 0 ;
Display* dpy ;
Window w ;
Pixmap bm0 ;
Colormap cmap ;
uint32_t white ;
uint32_t black ;
char data[8] = {0} ;
dpy = XOpenDisplay(NIL) ;
if (dpy == 0) throw 0x01 ;
white = WhitePixel (dpy,DefaultScreen(dpy)) ;
black = BlackPixel (dpy,DefaultScreen(dpy)) ;
w = XCreateSimpleWindow(dpy, RootWindow(dpy,0), 0,0, 640,480, 0, 0, black);
bm0 = XCreatePixmap (dpy,w,64,64,1 ) ; //leaks
// bm0 = XCreatePixmap (dpy,w,64,64,24) ; //doesn' leak
// bm0 = XCreateBitmapFromData (dpy,w,data,8,8) ; //leaks
XFreePixmap (dpy,bm0) ;
XDestroyWindow(dpy,w) ;
XCloseDisplay (dpy) ;
return 0 ;
}
Edited by Alan Coopersmith