From e6dbb9589e23e1aac936cc0d494b11e1c060c379 Mon Sep 17 00:00:00 2001 From: Nova Date: Thu, 12 Sep 2024 15:32:56 -0400 Subject: [PATCH] fix(audio): stop sound when dropped --- src/nodes/audio.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/nodes/audio.rs b/src/nodes/audio.rs index 725a9a2..205df13 100644 --- a/src/nodes/audio.rs +++ b/src/nodes/audio.rs @@ -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); }