Make sure the ResampleWorker task_receiver is also drained on drop

This commit is contained in:
JasonLG1979 2023-06-23 10:10:14 -05:00
parent 0e3ffe5394
commit bfb0366c90

View file

@ -288,6 +288,14 @@ impl ResampleWorker {
.ok();
}
ResampleTask::Terminate => {
loop {
let drained = task_receiver.recv().ok();
if drained.is_none() {
break;
}
}
match thread::current().name() {
Some(name) => debug!("<ResampleWorker> [{name}] thread finished"),
None => debug!("<ResampleWorker> thread finished"),