summaryrefslogtreecommitdiff
path: root/hw/xfree86/common/xf86Xinput.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-05-02 11:00:14 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-05-02 11:00:14 +0930
commit334456952930cb3e55c02fcdada2d0c074cd0520 (patch)
treedccc78d08cf18c68dfe38b498808f60da807c366 /hw/xfree86/common/xf86Xinput.c
parent8e56fd9728d63a7a48ef44503425c6e25c7c9ffb (diff)
parent3b8d53452cd6c74d32d7759964a7cd9ee775f161 (diff)
Merge branch 'master' into mpx
Conflicts: Xi/exevents.c dix/devices.c
Diffstat (limited to 'hw/xfree86/common/xf86Xinput.c')
-rw-r--r--hw/xfree86/common/xf86Xinput.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 527930642..e53756fc2 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -467,6 +467,8 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
LocalDevicePtr pInfo = (LocalDevicePtr) pDev->public.devicePrivate;
InputDriverPtr drv;
IDevRec *idev;
+ BOOL found;
+ IDevPtr *it;
if (pInfo) /* need to get these before RemoveDevice */
{
@@ -483,10 +485,18 @@ DeleteInputDeviceRequest(DeviceIntPtr pDev)
else
xf86DeleteInput(pInfo, 0);
- xfree(idev->driver);
- xfree(idev->identifier);
- xf86optionListFree(idev->commonOptions);
- xfree(idev);
+ /* devices added through HAL aren't in the config layout */
+ it = xf86ConfigLayout.inputs;
+ while(*it && *it != idev)
+ it++;
+
+ if (!(*it)) /* end of list, not in the layout */
+ {
+ xfree(idev->driver);
+ xfree(idev->identifier);
+ xf86optionListFree(idev->commonOptions);
+ xfree(idev);
+ }
}
/*