dix: free the unused device classes when closing a device.

This also requires to NULL-ify all pointers while we're actually using them,
otherwise we'd try to free them twice.
This commit is contained in:
Peter Hutterer
2008-04-15 15:09:40 +09:30
parent 48d33ab9b6
commit 51c8fd69ec
2 changed files with 20 additions and 6 deletions

View File

@@ -775,6 +775,13 @@ CloseDevice(DeviceIntPtr dev)
classes = (ClassesPtr)&dev->key;
FreeAllDeviceClasses(classes);
if (dev->isMaster)
{
classes = dixLookupPrivate(&dev->devPrivates, UnusedClassesPrivateKey);
FreeAllDeviceClasses(classes);
}
#ifdef XKB
while (dev->xkb_interest)
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);