aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2014-01-26 11:25:06 +0100
committerAleksander Morgado <aleksander@aleksander.es>2014-01-26 11:25:06 +0100
commitb7adbf97a560d8c4ae59d151872ed154c7e49822 (patch)
tree784a0997996a077a1daee5098b88f6e2e9225d81
parent72d83898da16015361c2fed216fe797678fca427 (diff)
port-probe: the 'buffer-full' signal is only used during AT probing
Make sure we cleanup the 'buffer-full' signal handler when moving from AT probing to QCDM probing, so that we don't try to remove a signal handler from a QCDM port in which we haven't set it. E.g. avoids: ModemManager[1493]: <debug> [1390731359.108502] [mm-port-probe.c:239] mm_port_probe_set_result_qcdm(): (tty/ttyHS2) port is QCDM-capable (ModemManager:1493): GLib-GObject-WARNING **: gsignal.c:2585: instance '0x7431b0' has no handler with id '16'
-rw-r--r--src/mm-port-probe.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c
index 73d132fc..4c64f2a9 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);
@@ -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);
}