summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-13 11:49:54 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-18 08:26:07 +1000
commit58bff17e43a80eb21b3ff6d4bb1596230e61f707 (patch)
tree8342a8bde66ee0778c5f5149a080b0e50b88499d /Xi
parent3420a7778c7d5eaa638327f31dd460554c257bb1 (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.c9
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;
}