aboutsummaryrefslogtreecommitdiff
path: root/src/mm-port-probe.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mm-port-probe.c')
-rw-r--r--src/mm-port-probe.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 8fb5706..4c64f2a 100644
--- a/src/mm-port-probe.c
+++ b/src/mm-port-probe.c
@@ -328,8 +328,10 @@ port_probe_run_task_free (PortProbeRunTask *task)
g_source_remove (task->source_id);
if (task->serial) {
- if (task->buffer_full_id)
+ if (task->buffer_full_id) {
+ g_warn_if_fail (MM_IS_AT_SERIAL_PORT (task->serial));
g_signal_handler_disconnect (task->serial, task->buffer_full_id);
+ }
if (mm_serial_port_is_open (task->serial))
mm_serial_port_close (task->serial);
g_object_unref (task->serial);
@@ -367,8 +369,8 @@ port_probe_run_task_complete (PortProbeRunTask *task,
{
/* As soon as we have the task completed, disable the buffer-full signal
* handling, so that we do not get unwanted errors reported */
- if (task->buffer_full_id) {
- g_source_remove (task->buffer_full_id);
+ if (task->serial && task->buffer_full_id) {
+ g_signal_handler_disconnect (task->serial, task->buffer_full_id);
task->buffer_full_id = 0;
}
@@ -658,6 +660,11 @@ serial_probe_qcdm (MMPortProbe *self)
/* If open, close the AT port */
if (task->serial) {
+ /* Explicitly clear the buffer full signal handler */
+ if (task->buffer_full_id) {
+ g_signal_handler_disconnect (task->serial, task->buffer_full_id);
+ task->buffer_full_id = 0;
+ }
mm_serial_port_close (task->serial);
g_object_unref (task->serial);
}
@@ -1146,7 +1153,6 @@ serial_open_at (MMPortProbe *self)
MM_SERIAL_PORT_SEND_DELAY, task->at_send_delay,
MM_AT_SERIAL_PORT_REMOVE_ECHO, task->at_remove_echo,
MM_AT_SERIAL_PORT_SEND_LF, task->at_send_lf,
- MM_PORT_CARRIER_DETECT, FALSE,
MM_SERIAL_PORT_SPEW_CONTROL, TRUE,
NULL);