summaryrefslogtreecommitdiffstats
path: root/scene/animation
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-09-09 17:51:42 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-09-09 17:51:42 +0200
commit493f3edce7c08642981d9445135996b4c28cb6ae (patch)
tree81694a86607e5e743a675f659d8e05637a74fa50 /scene/animation
parent9fa32267373e1f7716db79ac8ada10ef4750c801 (diff)
parentd3ddce6b8836bd6c39dc6ebc2a30102041953599 (diff)
downloadredot-engine-493f3edce7c08642981d9445135996b4c28cb6ae.tar.gz
Merge pull request #96572 from adamscott/fix-samples-leak
Fix leak when using audio samples instead of streams
Diffstat (limited to 'scene/animation')
-rw-r--r--scene/animation/animation_mixer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/scene/animation/animation_mixer.cpp b/scene/animation/animation_mixer.cpp
index 1c5f40f56e..664302d45e 100644
--- a/scene/animation/animation_mixer.cpp
+++ b/scene/animation/animation_mixer.cpp
@@ -1636,6 +1636,9 @@ void AnimationMixer::_blend_process(double p_delta, bool p_update_only) {
}
if (t_obj->call(SNAME("get_is_sample"))) {
+ if (t->audio_stream_playback->get_sample_playback().is_valid()) {
+ AudioServer::get_singleton()->stop_sample_playback(t->audio_stream_playback->get_sample_playback());
+ }
Ref<AudioSamplePlayback> sample_playback;
sample_playback.instantiate();
sample_playback->stream = stream;