Make sure DRI drawables are cleaned up when client dies.

The previous scheme didn't work when the client didn't create the core drawable,
e.g. the root or composite overlay window. Use refcounting via special client
resources to fix that.
This commit is contained in:
Michel Dänzer 2007-07-10 09:02:08 +02:00
commit 4abd00dab7
7 changed files with 130 additions and 62 deletions

View file

@ -61,6 +61,11 @@ xGLXSingleReply __glXReply;
*/
static __GLXclientState *__glXClients[MAXCLIENTS + 1];
/*
** Client that called into GLX dispatch.
*/
ClientPtr __pGlxClient;
/*
** Forward declarations.
*/
@ -549,6 +554,8 @@ static int __glXDispatch(ClientPtr client)
GLboolean rendering = opcode <= X_GLXRenderLarge;
__glXleaveServer(rendering);
__pGlxClient = client;
retval = (*proc)(cl, (GLbyte *) stuff);
__glXenterServer(rendering);