don't panic in Drop when video worker thread panics
This commit is contained in:
parent
24428186a3
commit
31a967f6da
1 changed files with 6 additions and 1 deletions
|
@ -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"),
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue