From 5c1d18d15675d43d9b3bb42adf6911e03823ad88 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Fri, 30 Dec 2011 18:33:21 +0100 Subject: [PATCH] port-probe: store the task always before completing it If we already got all needed probing results, we complete the task without launching any new probing, but still, we need to store it internally so that it's properly disposed. --- src/mm-port-probe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index e56f1879..3fef5cb5 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -736,6 +736,10 @@ mm_port_probe_run (MMPortProbe *self, } } + /* Store as current task. We need to keep it internally, as it will be + * freed during _finish() when the operation is completed. */ + self->priv->task = task; + /* All requested probings already available? If so, we're done */ if (!task->flags) { port_probe_run_task_complete (task, TRUE, NULL); @@ -745,9 +749,6 @@ mm_port_probe_run (MMPortProbe *self, /* Setup internal cancellable */ task->cancellable = g_cancellable_new (); - /* Store as current task */ - self->priv->task = task; - /* If any AT-specific probing requested, require generic AT check before */ if (task->flags & (MM_PORT_PROBE_AT_VENDOR | MM_PORT_PROBE_AT_PRODUCT)) {