Input: Plug memory leak in device free

Remember to also free the motion history, if we're using the DIX-managed
history.
This commit is contained in:
Magnus Vigerlöf 2007-04-10 23:43:58 +03:00 committed by Daniel Stone
parent e92743bc98
commit 07c56abf84

View File

@ -431,8 +431,13 @@ CloseDevice(DeviceIntPtr dev)
xfree(dev->key);
}
if (dev->valuator)
if (dev->valuator) {
/* Counterpart to 'biggest hack ever' in init. */
if (dev->valuator->motion &&
dev->valuator->GetMotionProc == GetMotionHistory)
xfree(dev->valuator->motion);
xfree(dev->valuator);
}
if (dev->button) {
#ifdef XKB