Browse Source

camera: Fix crash in LinuxCamera::has_cameras()

`timeout` needs to be called in an async block to make the future "lazy",
so that it is executed on the tokio runtime.
fractal-11
Kévin Commaille 11 months ago
parent
commit
6b9bf02bf9
No known key found for this signature in database
GPG Key ID: F26F4BE20A08255B
  1. 2
      src/components/camera/linux/mod.rs

2
src/components/camera/linux/mod.rs

@ -34,7 +34,7 @@ impl CameraExt for LinuxCamera {
}
}
};
let handle = spawn_tokio!(timeout(Duration::from_secs(1), fut));
let handle = spawn_tokio!(async move { timeout(Duration::from_secs(1), fut).await });
if let Ok(is_present) = handle.await.expect("task was not aborted") {
is_present

Loading…
Cancel
Save