Skip to content

Commit

Permalink
fix(audio): stop sound when dropped
Browse files Browse the repository at this point in the history
  • Loading branch information
technobaboo committed Sep 15, 2024
1 parent 6dae4a1 commit e6dbb95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/nodes/audio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit e6dbb95

Please sign in to comment.