-
- PyDict_SetItem(colorcache, rgb, (PyObject*)PixelRef_New(self->pixel));
-
- if (cleancache)
- OtkColor_DoCacheCleanup();
-}
-
-static void OtkColor_Deallocate(OtkColor *self) {
- PyObject *rgb, *pixref;
-
- if (!self->allocated)
- return;
-
- rgb = RGB_New(self->screen, self->red, self->green, self->blue);
- pixref = PyDict_GetItem(colorcache, rgb);
- if (pixref) {
- if (((PixelRef*)pixref)->count >= 1)
- ((PixelRef*)pixref)->count--;
- }
-