From b7adbf97a560d8c4ae59d151872ed154c7e49822 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sun, 26 Jan 2014 11:25:06 +0100 Subject: [PATCH] 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]: [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' --- src/mm-port-probe.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); }