From 9758fba743edde082cea40d35eed133766c96bd8 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Tue, 22 Mar 2016 21:00:31 +0100 Subject: [PATCH] port-probe: unlink the task from probe before completing it The task completion may try to enqueue a next probe task and in mm_port_probe_run() it asserts there's no task linked. https://bugs.freedesktop.org/show_bug.cgi?id=94664 Fixes: 1939c5ace50240127276efacec5c7f166483bb79 --- src/mm-port-probe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mm-port-probe.c b/src/mm-port-probe.c index c09b8a1..a1ca8ba 100644 --- a/src/mm-port-probe.c +++ b/src/mm-port-probe.c @@ -1023,6 +1023,7 @@ static void serial_probe_schedule (MMPortProbe *self) { PortProbeRunContext *ctx; + GTask *task; g_assert (self->priv->task); ctx = g_task_get_task_data (self->priv->task); @@ -1100,8 +1101,10 @@ serial_probe_schedule (MMPortProbe *self) } /* All done! */ - g_task_return_boolean (self->priv->task, TRUE); - g_clear_object (&self->priv->task); + task = self->priv->task; + self->priv->task = NULL; + g_task_return_boolean (task, TRUE); + g_object_unref (task); } static void -- 2.5.0