[PATCH:mouse] Plug minor memory leak.
Peter Hutterer
peter.hutterer at who-t.net
Wed Dec 2 17:39:07 PST 2009
This change splits the DEVICE_CLOSE behaviour from the DEVICE_OFF behaviour.
This doesn't change functionality as the server guarantees DEVICE_OFF to be
called first and DEVICE_CLOSE thus becomes a noop anyway.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/mouse.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/mouse.c b/src/mouse.c
index 8347be9..7571aeb 100644
--- a/src/mouse.c
+++ b/src/mouse.c
@@ -1709,7 +1709,6 @@ MouseProc(DeviceIntPtr device, int what)
break;
case DEVICE_OFF:
- case DEVICE_CLOSE:
if (pInfo->fd != -1) {
xf86RemoveEnabledDevice(pInfo);
if (pMse->buffer) {
@@ -1727,6 +1726,10 @@ MouseProc(DeviceIntPtr device, int what)
}
device->public.on = FALSE;
break;
+ case DEVICE_CLOSE:
+ xfree(pMse->mousePriv);
+ pMse->mousePriv = NULL;
+ break;
}
return Success;
}
--
1.6.5.2
More information about the xorg-devel
mailing list