Xi: don't use devices after removing them

RemoveDevice() frees the DeviceIntPtr, we shouldn't use the pointer after
that

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Peter Hutterer 2012-12-13 11:49:54 +10:00
parent 3420a7778c
commit 58bff17e43

View File

@ -304,15 +304,16 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
flags[keybd->id] |= XIDeviceDisabled;
flags[ptr->id] |= XIDeviceDisabled;
RemoveDevice(XTestptr, FALSE);
RemoveDevice(XTestkeybd, FALSE);
RemoveDevice(keybd, FALSE);
RemoveDevice(ptr, FALSE);
flags[XTestptr->id] |= XISlaveRemoved;
flags[XTestkeybd->id] |= XISlaveRemoved;
flags[keybd->id] |= XIMasterRemoved;
flags[ptr->id] |= XIMasterRemoved;
RemoveDevice(XTestptr, FALSE);
RemoveDevice(XTestkeybd, FALSE);
RemoveDevice(keybd, FALSE);
RemoveDevice(ptr, FALSE);
unwind:
return rc;
}