serial-port: ensure GCancellable handler is disconnected when serial port is closed

This commit is contained in:
Ben Chan
2013-09-26 00:10:59 -07:00
committed by Aleksander Morgado
parent 2a611c3856
commit b786ac0deb

View File

@@ -1112,6 +1112,13 @@ mm_serial_port_close (MMSerialPort *self)
priv->queue_id = 0; 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); g_clear_object (&priv->cancellable);
} }