diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-13 11:49:54 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2012-12-18 08:26:07 +1000 |
commit | 58bff17e43a80eb21b3ff6d4bb1596230e61f707 (patch) | |
tree | 8342a8bde66ee0778c5f5149a080b0e50b88499d /Xi | |
parent | 3420a7778c7d5eaa638327f31dd460554c257bb1 (diff) |
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>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/xichangehierarchy.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Xi/xichangehierarchy.c b/Xi/xichangehierarchy.c index 89f16d8be..4dc3d76e9 100644 --- a/Xi/xichangehierarchy.c +++ b/Xi/xichangehierarchy.c @@ -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; } |