Commit e57d6a89 authored by Peter Hutterer's avatar Peter Hutterer
Browse files

dix: move freeing the sprite into a function


Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: default avatarChase Douglas <chase.douglas@canonical.com>
parent 46adcefb
......@@ -918,12 +918,7 @@ CloseDevice(DeviceIntPtr dev)
free(classes);
}
if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
if (dev->spriteInfo->sprite->current)
FreeCursor(dev->spriteInfo->sprite->current, None);
free(dev->spriteInfo->sprite->spriteTrace);
free(dev->spriteInfo->sprite);
}
FreeSprite(dev);
/* a client may have the device set as client pointer */
for (j = 0; j < currentMaxClients; j++) {
......
......@@ -3192,6 +3192,18 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
#endif
}
void FreeSprite(DeviceIntPtr dev)
{
if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
if (dev->spriteInfo->sprite->current)
FreeCursor(dev->spriteInfo->sprite->current, None);
free(dev->spriteInfo->sprite->spriteTrace);
free(dev->spriteInfo->sprite);
}
dev->spriteInfo->sprite = NULL;
}
/**
* Update the mouse sprite info when the server switches from a pScreen to another.
* Otherwise, the pScreen of the mouse sprite is never updated when we switch
......
......@@ -395,6 +395,8 @@ DeliverTouchEvents(DeviceIntPtr /* dev */ ,
extern void
InitializeSprite(DeviceIntPtr /* pDev */ ,
WindowPtr /* pWin */ );
extern void
FreeSprite(DeviceIntPtr pDev);
extern void
UpdateSpriteForScreen(DeviceIntPtr /* pDev */ ,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment