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

Frank Binns frank.binns at imgtec.com
Thu Apr 24 03:37:47 PDT 2014


From: Brendan King <brendan.king at imgtec.com>

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 at imgtec.com>
---
 dix/devices.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dix/devices.c b/dix/devices.c
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);
 
     /* 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) {
-- 
1.8.5.4.gfdaaaa2



More information about the xorg-devel mailing list