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:
parent
9de1ebe2a8
commit
497862df2f
|
@ -859,6 +859,17 @@ CloseDownDevices(void)
|
||||||
{
|
{
|
||||||
DeviceIntPtr dev, next;
|
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)
|
for (dev = inputInfo.devices; dev; dev = next)
|
||||||
{
|
{
|
||||||
next = dev->next;
|
next = dev->next;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user