aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/dix')
-rw-r--r--xorg-server/dix/devices.c7
-rw-r--r--xorg-server/dix/events.c2
2 files changed, 4 insertions, 5 deletions
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 106d2dfc7..468b5a199 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -947,8 +947,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);
/* free acceleration info */
@@ -969,8 +970,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) {
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index d606e727c..e3f5e2372 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -3241,7 +3241,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
pCursor = RefCursor(pCursor);
if (pSprite->current)
FreeCursor(pSprite->current, None);
- pSprite->current = RefCursor(pCursor);
+ pSprite->current = pCursor;
if (pScreen) {
(*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current);