diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-15 15:09:40 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-04-15 15:09:40 +0930 |
commit | 51c8fd69ec9292f5e18cdc7f60e1716fbd6ae61a (patch) | |
tree | 5ed75b301611527caa35d17d1af908af1b0c1194 /dix/devices.c | |
parent | 48d33ab9b672b3b3ca308000cdbd573d1e368ff9 (diff) |
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.
Diffstat (limited to 'dix/devices.c')
-rw-r--r-- | dix/devices.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dix/devices.c b/dix/devices.c index d4459168f..fe70e7870 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -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); |