aboutsummaryrefslogtreecommitdiff
path: root/src/mm-plugin-manager.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2019-11-13 15:32:04 +0100
committerAleksander Morgado <aleksander@aleksander.es>2019-11-13 15:43:11 +0100
commit3da82d10501aae216d3a77c85d2d42c9b0d8a6d1 (patch)
treec67d5d97f6ef28ec551f13ed7431399a08d23804 /src/mm-plugin-manager.c
parent76e862597cbffd6073523eeb842a886f5d5742e9 (diff)
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.
Diffstat (limited to 'src/mm-plugin-manager.c')
-rw-r--r--src/mm-plugin-manager.c10
1 files changed, 10 insertions, 0 deletions
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);