Fix cursor ref counting mistakes with sprites and xf86Cursor.c

A few cursor value assignments weren't getting correctly ref counted,
causing leaks of cursor objects.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Keith Packard
2010-04-30 12:18:09 -07:00
parent a80b1f888f
commit cdeb2c23f8
3 changed files with 19 additions and 5 deletions

View File

@@ -851,6 +851,8 @@ CloseDevice(DeviceIntPtr dev)
}
if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
if (dev->spriteInfo->sprite->current)
FreeCursor(dev->spriteInfo->sprite->current, None);
xfree(dev->spriteInfo->sprite->spriteTrace);
xfree(dev->spriteInfo->sprite);
}