[PATCH] [xorg/xserver] mi/misprite: release private record
daniel at fooishbar.org
Wed Mar 9 06:42:04 PST 2011
On Wed, Mar 09, 2011 at 04:19:06PM +0200, Erkki Seppala wrote:
> On 09.03.2011 15:57, Daniel Stone wrote:
> >You could get this automatically by having miSpriteDevPrivatesKey
> >allocate sizeof(miCursorInfoRec), rather than doing the allocation and
> >free separately.
> Thanks for the feedback!
> I considered this with Rami, but it appeared that it uses the
> NULLness of the pointer for making a decision. In file misprite.c:
> pCursorInfo = MISPRITE(pDev);
> if (pCursorInfo && !pCursorInfo->isUp
> && pCursorInfo->pScreen == pScreen
> && pCursorInfo->shouldBeUp)
> So at least this code is prepared to handle the case that the
> privates are not allocated. Is this something that can never
> actually happen, and therefore one could just use the automated
> (I guess I should've mentioned this in the commit message already ;-).)
Heh. Well, if you allocate space with the private key it comes
pre-calloced, so pCursorInfo->shouldBeUp will never be true, and
pCursorInfo->pScreen will never match.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: Digital signature
More information about the xorg-devel