[PATCH v2] [xorg/xserver] mi/misprite: use memory management provided by dixRegisterPrivateKey

Daniel Stone daniel at fooishbar.org
Wed Mar 9 08:55:04 PST 2011


Hi,

On Wed, Mar 09, 2011 at 05:29:14PM +0200, Erkki Seppälä wrote:
> The record allocated by miSpriteDeviceCursorInitialize was not being
> released.
> 
> This patch makes misprite use dixRegisterPrivateKey with the record
> size argument, which handles the memory management
> issues. miSpriteDeviceCursorInitialize is restructured to initialize
> pCursorInfo only if miDCDeviceInitialize succeeds. The record itself
> is zeroed on cleanup to ensure that the assumptions in the code still
> hold.
> 
> Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>

Looks fine to me.  miSpriteDeviceCursorInitialize gets called as
spriteFuncs->DeviceCursorInitialize from miPointerDeviceInitialize,
which gets called as pScreen->DeviceCursorInitialize from
ActivateDevice.

Similarly, miSpriteDeviceCursorCleanup only gets called after a
DEVICE_CLOSE from CloseDevice(), and we shouldn't get any more events
after that; AccelCleanupProc doesn't post any events either, just, er,
cleans up.

So this looks fine to me.  Thanks! There are many other potential fixes
just like this one lurking in misprite.c and mipointer.c if that
horrible mess hasn't scared you off yet.

Reviewed-by: Daniel Stone <daniel at fooishbar.org>

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110309/fa8a8574/attachment.pgp>


More information about the xorg-devel mailing list