Path: utzoo!attcan!uunet!ingr!b11!dwig From: dwig@b11.ingr.com (David Wiggins) Newsgroups: comp.windows.x Subject: Re: XAllocColor/XFreeColors question Message-ID: <9152@b11.ingr.com> Date: 20 Oct 90 15:12:47 GMT References: <31383@netnews.upenn.edu> Distribution: na Organization: Intergraph Corp. Huntsville, AL Lines: 34 bradley@grip.cis.upenn.edu (John Bradley) writes: >Situation: I allocate two read-only color cells. Because the colors were >exactly the same, (or because the colors were different, but the *displayable* >colors were the same (happens all the time on machines with 4-bit RGB D/As)), >I've actually allocated the same color cell twice. In and of itself, not >a problem. >However, when I want to free the color cells, I have a bit of a problem. On >certain MIT X11R4 servers, I've seen that color cells are not released unless >they are freed the same number of times that they were allocated, even if >the multiple allocations were all from one client. This seems like perfectly >reasonable behavior, and I can live with it. >Unfortunately, OTHER X servers (IBM 6000/AIX 3.1, and others) get all bent- >out-of-shape if I try to free the same color cell more than once. >Question: Which behavior is 'correct'? The Xlib manual doesn't really seem >to say what should happen. >--jhb Cut-n-pasted directly from the protocol document: FreeColors ...a read-only entry is not actually freed until it has been freed by all clients, and if a client allo- cates the same read-only entry multiple times, it must free the entry that many times before the entry is actually freed. David P. Wiggins dwig@ingr.com or uunet!ingr!dwig (205)730-6365 Intergraph Corporation, One Madison Industrial Park, Huntsville, AL 35807