[PATCH] glx: Fix lifetime tracking for pixmaps

Adam Jackson ajax at redhat.com
Tue Mar 29 06:48:21 PDT 2011


On Tue, 2011-03-29 at 10:09 +0200, Michel Dänzer wrote:
> On Mon, 2011-03-28 at 12:40 -0400, Adam Jackson wrote: 
> > diff --git a/glx/glxcmds.c b/glx/glxcmds.c
> > index 9b4bc9e..9d60bdb 100644
> > --- a/glx/glxcmds.c
> > +++ b/glx/glxcmds.c
> > @@ -1177,10 +1177,11 @@ DoCreateGLXDrawable(ClientPtr client, __GLXscreen *pGlxScreen,
> >  	return BadAlloc;
> >      }
> >  
> > -    /* Add the glx drawable under the XID of the underlying X drawable
> > -     * too.  That way we'll get a callback in DrawableGone and can
> > -     * clean up properly when the drawable is destroyed. */
> > -    if (drawableId != glxDrawableId &&
> > +    /*
> > +     * Windows aren't refcounted, so track both the X and the GLX window
> > +     * so we get called regardless of destruction order.
> > +     */
> > +    if (drawableId != glxDrawableId && type == GLX_DRAWABLE_WINDOW &&
> >  	!AddResource(pDraw->id, __glXDrawableRes, pGlxDraw)) {
> 
> Is pDraw->id == drawableId always true here for windows? That was one of
> the issues previously proposed fixes in this area were trying to
> address.

Yes.  This is only called for windows from the CreateWindow path:

    err = dixLookupDrawable(&pDraw, req->window, client, 0,
DixAddAccess);
    /* ... */
    return DoCreateGLXDrawable(client, pGlxScreen, config,
                               pDraw, req->window,
                               req->glxwindow, GLX_DRAWABLE_WINDOW);

However it would probably be clearer to change it to be drawableId for
symmetry with the AddResource call immediately above.

- ajax
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110329/aa43c178/attachment.pgp>


More information about the xorg-devel mailing list