dix: explicitly float all attached SDs before closing down devices.

Some drivers flush on shutdown, if our SD is still attached we'd be trying to
route an event through a non-existing device.
This commit is contained in:
Peter Hutterer 2007-11-16 11:20:22 +10:30
parent 9de1ebe2a8
commit 497862df2f

View File

@ -859,6 +859,17 @@ CloseDownDevices(void)
{
DeviceIntPtr dev, next;
/* Float all SDs before closing them. Note that at this point resources
* (e.g. cursors) have been freed already, so we can't just call
* AttachDevice(NULL, dev, NULL). Instead, we have to forcibly set master
* to NULL and pretend nothing happened.
*/
for (dev = inputInfo.devices; dev; dev = dev->next)
{
if (!dev->isMaster && dev->u.master)
dev->u.master = NULL;
}
for (dev = inputInfo.devices; dev; dev = next)
{
next = dev->next;