don't panic in Drop when video worker thread panics

This commit is contained in:
Marcus Lian Hanestad 2025-01-01 21:18:57 +01:00
parent 24428186a3
commit 31a967f6da
No known key found for this signature in database
GPG key ID: A2487054CC24BE31

View file

@ -189,7 +189,12 @@ impl Drop for Video {
inner.alive.store(false, Ordering::SeqCst);
if let Some(worker) = inner.worker.take() {
worker.join().expect("failed to stop video thread");
if let Err(err) = worker.join() {
match err.downcast_ref::<String>() {
Some(e) => log::error!("Video thread panicked: {e}"),
None => log::error!("Video thread panicked with unknown reason"),
}
}
}
}
}