From 3da82d10501aae216d3a77c85d2d42c9b0d8a6d1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 13 Nov 2019 15:32:04 +0100 Subject: plugin-manager: cancel timeouts when device probing is cancelled There is no need to wait for the minimum wait/probing time before we can cancel the device probing. --- src/mm-plugin-manager.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mm-plugin-manager.c') diff --git a/src/mm-plugin-manager.c b/src/mm-plugin-manager.c index fb21305d..b46b3a6f 100644 --- a/src/mm-plugin-manager.c +++ b/src/mm-plugin-manager.c @@ -1258,6 +1258,16 @@ device_context_cancel (DeviceContext *device_context) g_list_foreach (device_context->port_contexts, (GFunc) port_context_cancel, NULL); } + /* Cancel all timeouts */ + if (device_context->min_wait_time_id) { + g_source_remove (device_context->min_wait_time_id); + device_context->min_wait_time_id = 0; + } + if (device_context->min_probing_time_id) { + g_source_remove (device_context->min_probing_time_id); + device_context->min_probing_time_id = 0; + } + /* Wakeup the device context logic. If we were still waiting for the * min probing time, this will complete the device context. */ device_context_continue (device_context); -- cgit v1.2.3-70-g09d2