[921] in Zephyr_Bugs

home help back first fref pref prev next nref lref last post

Re: zwgc: Error in XAllocColor

daemon@ATHENA.MIT.EDU (Gregory S. Stark)
Sat Mar 28 16:26:14 1998

To: Greg Hudson <ghudson@MIT.EDU>
Cc: Jeff Evarts <jde@va.pubnix.com>, bug-zephyr@MIT.EDU
From: gsstark@MIT.EDU (Gregory S. Stark)
In-Reply-To: Greg Hudson's message of "Sat, 28 Mar 1998 10:35:51 -0500"
Date: 28 Mar 1998 16:26:06 -0500


Greg Hudson <ghudson@MIT.EDU> writes:
> > it seems like we could keep all the colors in a list, then empty the
> > list when the window-painting routine is complete.
> 
> My understanding is that you must keep the color allocated as long as
> you're using it in a drawable.  (It certainly wouldn't make sense that
> you could deallocate a color you have drawn; otherwise you could
> easily get more than 256 colors on an 8-bit display.)
> 
> So if we draw windowgram 1 and then draw windowgram 2, when windowgram
> 2 goes away we can't free all of its colors or we might free colors
> which are still being displayed in windowgram 1.

Marc once proposed a simple solution that would accomplish a lot. Whenever
zwgc has no windows mapped, free all the colours it has allocated. 

This would solve the most annoying (arguably a denial of service attack)
situation where someone sends you a zephyr containing a large number of
zephyrs. 

greg


home help back first fref pref prev next nref lref last post