fix poll after completion error

This commit is contained in:
Ferdinand Schober
2025-07-28 16:32:55 +02:00
committed by Ferdinand Schober
parent 7fa74811e8
commit fa8c6e3b1c

View File

@@ -587,9 +587,13 @@ impl LanMouseInputCapture for LibeiInputCapture<'_> {
self.cancellation_token.cancel();
let task = &mut self.capture_task;
log::debug!("waiting for capture to terminate...");
let res = task.await.expect("libei task panic");
log::debug!("done!");
let res = if !task.is_finished() {
task.await.expect("libei task panic")
} else {
Ok(())
};
self.terminated = true;
log::debug!("done!");
res
}
}