Merge pull request #23 from MAlba124/report-video-thread-panic
don't panic in Drop when video worker thread panics
This commit is contained in:
commit
583ef3cd3d
1 changed files with 6 additions and 1 deletions
|
@ -189,7 +189,12 @@ impl Drop for Video {
|
||||||
|
|
||||||
inner.alive.store(false, Ordering::SeqCst);
|
inner.alive.store(false, Ordering::SeqCst);
|
||||||
if let Some(worker) = inner.worker.take() {
|
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