我用下一个代码分配了一个颜色条目,然后我用它来正确绘制:
char *color_name = "red";
XColor color, exact;
XAllocNamedColor(display, colormap, color_name, &color, &exact);
然后,当我不再需要颜色条目时,我尝试释放它:
XFreeColors(display, colormap, &color.pixel, 1, 0);
此调用生成下一个错误:
Error of failed request: BadAccess (attempt to access private resource denied)
Major opcode of failed request: 88 (X_FreeColors)
Serial number of failed request: 17
Current serial number in output stream: 19
有什么我做错了吗?如何释放该颜色条目?应该释放那个颜色条目?