void destroy() { int xDisplay = device.xDisplay; int pixel = handle.pixel; if (device.colorRefCount != null) { /* If this was the last reference, remove the color from the list */ if (--device.colorRefCount[pixel] == 0) { device.xcolors[pixel] = null; } } int colormap = OS.XDefaultColormap(xDisplay, OS.XDefaultScreen(xDisplay)); OS.XFreeColors(xDisplay, colormap, new int[] {pixel}, 1, 0); handle = null; }