summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-12-10 13:33:37 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-11 13:46:39 +1000
commit537e5206fd270420dd6b5de0bc7fdc5b45ef55f9 (patch)
tree3980d258ebdc092e3fde3f808d964b753a067e95
parent8069245fd531b1302e8aa0de82b4c6f66028715f (diff)
Don't destroy the timer on DeviceOff.
DeviceOff is VT switch, DeviceClose is unplug. We need the timer pre-allocated since we set it during the signal handler and so can't allocate it then, so merely cancel it at DeviceOff, and delete it in DeviceClose. Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit babe5288271f3c088d9aac3ffd9f036c87b0018e)
-rw-r--r--src/synaptics.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index e0d3555..e9d1833 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -793,8 +793,7 @@ DeviceOff(DeviceIntPtr dev)
DBG(3, ErrorF("Synaptics DeviceOff called\n"));
if (local->fd != -1) {
- TimerFree(priv->timer);
- priv->timer = NULL;
+ TimerCancel(priv->timer);
xf86RemoveEnabledDevice(local);
if (priv->proto_ops->DeviceOffHook)
priv->proto_ops->DeviceOffHook(local);
@@ -816,6 +815,8 @@ DeviceClose(DeviceIntPtr dev)
SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
RetValue = DeviceOff(dev);
+ TimerFree(priv->timer);
+ priv->timer = NULL;
free_param_data(priv);
return RetValue;
}