diff options
-rw-r--r-- | src/mm-serial-port.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c index 8b683dd3..18a616d9 100644 --- a/src/mm-serial-port.c +++ b/src/mm-serial-port.c @@ -837,6 +837,8 @@ mm_serial_port_close (MMSerialPort *self) priv->connected_id = 0; } + mm_serial_port_flash_cancel (self); + if (priv->fd >= 0) { GTimeVal tv_start, tv_end; @@ -852,8 +854,6 @@ mm_serial_port_close (MMSerialPort *self) priv->channel = NULL; } - mm_serial_port_flash_cancel (self); - g_get_current_time (&tv_start); tcsetattr (priv->fd, TCSANOW, &priv->old_t); @@ -901,6 +901,16 @@ mm_serial_port_close (MMSerialPort *self) g_slice_free (MMQueueData, item); } g_queue_clear (priv->queue); + + if (priv->timeout_id) { + g_source_remove (priv->timeout_id); + priv->timeout_id = 0; + } + + if (priv->queue_id) { + g_source_remove (priv->queue_id); + priv->queue_id = 0; + } } void |