I've been using the TTS crate in one of my projects, and noticed that whenever a Tts object is dropped, it leaves behind MediaPlayer instances, seemingly not cleaning them up.
Example code to trigger:
fn main() {
for _ in 0..5 {
let mut tts = Tts::default().unwrap();
let _ = tts.speak("Hello", false);
sleep(Duration::from_secs(2));
drop(tts);
}
sleep(Duration::from_secs(20));
}
The result is 5 MediaPlayer SMTC windows being left behind until the application exists:
Did some digging, looks like this is a bug in windows::Media::Playback::MediaPlayer, and not tts-rs, neither calling .Close or dropping a MediaPlayer instance cleans up correctly. I'll close this.
Hi there,
I've been using the TTS crate in one of my projects, and noticed that whenever a Tts object is dropped, it leaves behind MediaPlayer instances, seemingly not cleaning them up.
Example code to trigger:
The result is 5 MediaPlayer SMTC windows being left behind until the application exists:
Tested on 0.26.0