0
我分配下一個代碼顏色項Xlib中一個顏色表項,然後我用它來正確繪製:無法釋放與XFreeColors()
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
有什麼我做錯了嗎?我怎樣才能釋放該顏色條目?該顏色條目應該被釋放?