summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-12-03 11:27:30 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-08 11:04:22 +1000
commitc6ff6c3bba57a5134b050bead65dd6a1ff2f42aa (patch)
tree9c20377a40cb8777271baad05d2074d2ff728dc9
parent6ac394cafc959980893553955e98827c7cb45119 (diff)
Plug minor memory leak.
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@who-t.net> Reviewed-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r--src/mouse.c5
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;
}