[PATCH 3/4] dix: fix pixmap leak on server reset

Keith Packard keithp at keithp.com
Thu May 22 17:09:50 PDT 2014


Frank Binns <frank.binns at imgtec.com> writes:

> index ab923d5..a5bbe23 100644
> --- a/dix/devices.c
> +++ b/dix/devices.c
> @@ -946,8 +946,9 @@ CloseDevice(DeviceIntPtr dev)
>      if (dev->inited)
>          (void) (*dev->deviceProc) (dev, DEVICE_CLOSE);
>  
> -    /* free sprite memory */
> -    if (IsMaster(dev) && dev->spriteInfo->sprite)
> +    FreeSprite(dev);
> +
> +    if (IsMaster(dev))
>          screen->DeviceCursorCleanup(dev, screen);

Can you explain how this helps? From what I can see, you're simply
removing the check for dev->spriteInfo->sprite, which is necessary only
because you've freed the sprite before checking.

>  
>      /* free acceleration info */
> @@ -968,8 +969,6 @@ CloseDevice(DeviceIntPtr dev)
>          free(classes);
>      }
>  
> -    FreeSprite(dev);
> -
>      /* a client may have the device set as client pointer */
>      for (j = 0; j < currentMaxClients; j++) {
>          if (clients[j] && clients[j]->clientPtr == dev) {

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


More information about the xorg-devel mailing list