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.
This commit is contained in:
Aleksander Morgado
2019-11-13 15:43:11 +01:00
parent 76e862597c
commit 3da82d1050
+10
View File
@@ -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);