From fa8c6e3b1c94df889c5178b0c99457dfedfd838c Mon Sep 17 00:00:00 2001 From: Ferdinand Schober Date: Mon, 28 Jul 2025 16:32:55 +0200 Subject: [PATCH] fix poll after completion error --- input-capture/src/libei.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/input-capture/src/libei.rs b/input-capture/src/libei.rs index 9edf764..95f9cd5 100644 --- a/input-capture/src/libei.rs +++ b/input-capture/src/libei.rs @@ -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 } }