[PATCH 3/7] Use FreePixmap to free the fbPixmap in case the driver forgot

Keith Packard keithp at keithp.com
Wed May 12 16:11:23 PDT 2010


On Wed, 12 May 2010 15:53:34 -0700, Alan Coopersmith <alan.coopersmith at oracle.com> wrote:
> Keith Packard wrote:
> >      free(pScreen->devPrivate);
> > +    if (pScreen->devPrivate) {
> > +	FreePixmap(pScreen->devPrivate);
> > +	pScreen->devPrivate = NULL;
> > +    }
> 
> Shouldn't you delete the initial free then, so you're not referencing
> the pointer you just free'd ?

Oops. Merge fail. I almost didn't stick this here as drivers really
should free the screen pixmap on their own; any driver allocations will
be lost with this call. And, no we can't call pScreen->DestroyPixmap as
we're nearly at the bottom of CloseScreen and DestroyPixmap will almost
certainly try to reference data which has already been freed.

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20100512/441ee6e1/attachment.pgp>


More information about the xorg-devel mailing list