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'
This commit is contained in:
Aleksander Morgado
2014-01-26 11:25:06 +01:00
parent 72d83898da
commit b7adbf97a5

View File

@@ -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);
}