[PATCH] serial-port: ensure GCancellable handler is disconnected when serial port is closed

Aleksander Morgado aleksander at lanedo.com
Thu Sep 26 00:22:56 PDT 2013


On 09/26/2013 09:10 AM, Ben Chan wrote:
> ---
>  src/mm-serial-port.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Pushed, thanks.

> diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
> index 8774d40..dd82ce9 100644
> --- a/src/mm-serial-port.c
> +++ b/src/mm-serial-port.c
> @@ -1112,6 +1112,13 @@ mm_serial_port_close (MMSerialPort *self)
>          priv->queue_id = 0;
>      }
>  
> +    if (priv->cancellable_id) {
> +        g_assert (priv->cancellable != NULL);
> +        g_cancellable_disconnect (priv->cancellable,
> +                                  priv->cancellable_id);
> +        priv->cancellable_id = 0;
> +    }
> +
>      g_clear_object (&priv->cancellable);
>  }
>  
> 


-- 
Aleksander


More information about the ModemManager-devel mailing list