This is a discussion on Memory used by Xserver is growing - Xwindows ; Hello all, I am using the following code (reduced to the essential): .... attributes.valuemask = XpmVisual|XpmColormap|XpmSize| XpmHotspot |XpmExactColors|XpmAllocCloseColors|XpmCloseness| XpmRGBCloseness; attributes.visual = visual; attributes.colormap = cm; attributes.exactColors = FALSE; attributes.alloc_close_colors = FALSE; attributes.closeness = 65535; attributes.red_closeness = 65535; attributes.green_closeness = 65535; ...
Hello all,
I am using the following code (reduced to the essential):
....
attributes.valuemask = XpmVisual|XpmColormap|XpmSize|
XpmHotspot
|XpmExactColors|XpmAllocCloseColors|XpmCloseness|
XpmRGBCloseness;
attributes.visual = visual;
attributes.colormap = cm;
attributes.exactColors = FALSE;
attributes.alloc_close_colors = FALSE;
attributes.closeness = 65535;
attributes.red_closeness = 65535;
attributes.green_closeness = 65535;
attributes.blue_closeness = 65535;
ret = XpmCreatePixmapFromXpmImage(di, rootwin, xpm_image,
&pix, &shapepix, &attributes);
if(ret != XpmSuccess)
{
return;
}
XpmFreeAttributes(&attributes);
XFreePixmap(di, pix);
if(shapepix != 0)
{
XFreePixmap(di, shapepix);
}
....
If I am calling this code over and over again, the memory used by the
XServer is constantly growing.
In the XPM manual I found the following sentence: "When finished the
caller must free ... the colors using XFreeColors ...." . But what
colors must be freed? Or must anything else be freed?
Thank you in advance for your help.
Dieter