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.
This commit is contained in:
Aleksander Morgado
2012-03-15 14:14:41 +01:00
parent 51dc93e3d5
commit 5c1d18d156
+4 -3
View File
@@ -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)) {