summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorBrendan King <brendan.king@imgtec.com>2014-04-24 11:37:47 +0100
committerKeith Packard <keithp@keithp.com>2014-06-04 21:32:30 -0700
commitb92d86a982504af2605042c19ef796d135074ee1 (patch)
tree908e99dfbb13c7fe89cb2feaebf862bb91dcbd44 /dix
parenta99c061aafd4aaa5728c776dca7d0a1789ac739a (diff)
dix: fix pixmap leak on server reset
The server is leaking a pixmap (created by CreateDefaultStipple()) on reset. The leak is caused by some X Server graphics contexts not being freed on reset by the machine independent cursor code in the server, which in turn is caused by the cursor cleanup code (miSpriteDeviceCursorCleanup()) not being called. Ensures the DeviceCursorCleanup() function is called when the associated input device is closed on server reset. Signed-off-by: Frank Binns <frank.binns@imgtec.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'dix')
-rw-r--r--dix/devices.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dix/devices.c b/dix/devices.c
index 73f60f46e..7f079ffa1 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);
/* 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) {