[PATCH] Don't destroy the timer on DeviceOff.

Peter Hutterer peter.hutterer at who-t.net
Thu Dec 10 17:01:12 PST 2009


On Thu, Dec 10, 2009 at 01:33:37PM -0500, Adam Jackson wrote:
> 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 at redhat.com>
> ---
>  src/synaptics.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/synaptics.c b/src/synaptics.c
> index d9b8f50..0fdc496 100644
> --- a/src/synaptics.c
> +++ b/src/synaptics.c
> @@ -779,8 +779,7 @@ DeviceOff(DeviceIntPtr dev)
>      DBG(3, "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);
> @@ -802,6 +801,8 @@ DeviceClose(DeviceIntPtr dev)
>      SynapticsPrivate *priv = (SynapticsPrivate *) local->private;
>  
>      RetValue = DeviceOff(dev);
> +    TimerFree(priv->timer);
> +    priv->timer = NULL;
>      free_param_data(priv);
>      return RetValue;
>  }
> -- 

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

merged, will push in a tick.

Cheers,
  Peter


More information about the xorg-devel mailing list