From b8ad2742675dcfb1ab00e035dd73cb96258a3d3c Mon Sep 17 00:00:00 2001 From: fufesou Date: Sat, 12 Sep 2026 23:16:49 +0800 Subject: [PATCH] Follow upstream WASAPI teardown without stderr diagnostics --- src/host/wasapi/stream.rs | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/host/wasapi/stream.rs b/src/host/wasapi/stream.rs index 95255d8..c558a8c 100644 --- a/src/host/wasapi/stream.rs +++ b/src/host/wasapi/stream.rs @@ -4,7 +4,6 @@ use crate::{ BackendSpecificError, Data, InputCallbackInfo, OutputCallbackInfo, PauseStreamError, PlayStreamError, SampleFormat, StreamError, }; -use std::io::{self, Write}; use std::mem; use std::os::windows::io::{AsRawHandle, FromRawHandle, OwnedHandle}; use std::ptr; @@ -176,21 +175,10 @@ impl Stream { impl Drop for Stream { #[inline] fn drop(&mut self) { - // eprintln! panics on stderr write errors, e.g. a closed pipe reporting - // ERROR_NO_DATA (232), which Rust maps to BrokenPipe. Ignore diagnostic - // I/O errors so worker joining and handle cleanup still run. - if let Err(error) = self.push_command(Command::Terminate) { - let _ = writeln!( - io::stderr().lock(), - "cpal: WASAPI termination notification failed: {error}" - ); - } + let _ = self.push_command(Command::Terminate); if let Some(thread) = self.thread.take() { - if thread.thread().id() != thread::current().id() && thread.join().is_err() { - let _ = writeln!( - io::stderr().lock(), - "cpal: WASAPI worker panicked during stream processing" - ); + if thread.thread().id() != thread::current().id() { + let _ = thread.join(); } } }