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

Keith Packard keithp at keithp.com
Thu Dec 10 17:10:06 PST 2009


On Thu, 10 Dec 2009 13:33:37 -0500, Adam Jackson <ajax at redhat.com> 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>

Reviewed-by: Keith Packard <keithp at keithp.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;
>  }
> -- 
> 1.6.5.2
> 
> _______________________________________________
> xorg-devel mailing list
> xorg-devel at lists.x.org
> http://lists.x.org/mailman/listinfo/xorg-devel

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.x.org/archives/xorg-devel/attachments/20091210/d921f5a8/attachment.pgp 


More information about the xorg-devel mailing list