fix(audio): stop sound when dropped

This commit is contained in:
Nova
2024-09-12 15:32:56 -04:00
parent 7e755a44b8
commit a51db703fd

View File

@@ -85,6 +85,9 @@ impl SoundAspect for Sound {
}
impl Drop for Sound {
fn drop(&mut self) {
if let Some(instance) = self.instance.lock().take() {
instance.stop();
}
if let Some(sk_sound) = self.sk_sound.take() {
destroy_queue::add(sk_sound);
}