[919] in Zephyr_Bugs
Re: zwgc: Error in XAllocColor
daemon@ATHENA.MIT.EDU (Jeff Evarts)
Fri Mar 27 16:52:41 1998
Date: Fri, 27 Mar 1998 16:52:37 -0500
From: Jeff Evarts <jde@va.pubnix.com>
To: ghudson@MIT.EDU, bug-zephyr@MIT.EDU
Greg Hudson wrote:
>
> > I gave a TRIVIAL look at the code, and noticed that XFreeColors is
> > never called to release the colors allocated by XAllocColor... is
> > this correct behavior?
>
> Not really. It's a little hard to fix because, at least as I remember
> it, if you allocate the same color twice you're still only supposed to
> free it once. So we'd have to add a table to keep track of colors.
Yeah, but we allocate the color every time we open a window...
it seems like we could keep all the colors in a list, then
empty the list when the window-painting routine is complete.
No additional overhead on the allocation side, since we reallocate
for each window. XFreeColors even lets you free more than one
color per call.
>
> At any rate, failure to allocate a color is often attributable to a
> very colorful background or to a netscape process.
-Jeff
--
Jeff Evarts
jde@va.pubnix.com
http://www.ecst.csuchico.edu/~amarth
Do not mistake my opinions for those of my employer.