diff options
| author | Adam Scott <ascott.ca@gmail.com> | 2024-09-04 12:04:27 -0400 |
|---|---|---|
| committer | Adam Scott <ascott.ca@gmail.com> | 2024-09-04 12:56:03 -0400 |
| commit | d3ddce6b8836bd6c39dc6ebc2a30102041953599 (patch) | |
| tree | 5f281943bce0a33c45ebe4e39a81f21f760dfa41 /modules/vorbis | |
| parent | e2dd56bea7a1aa13fe74fd6eac049e4cbde0434c (diff) | |
| download | redot-engine-d3ddce6b8836bd6c39dc6ebc2a30102041953599.tar.gz | |
Fix leak when using audio samples instead of streams
Diffstat (limited to 'modules/vorbis')
| -rw-r--r-- | modules/vorbis/audio_stream_ogg_vorbis.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/vorbis/audio_stream_ogg_vorbis.cpp b/modules/vorbis/audio_stream_ogg_vorbis.cpp index ff032c88c6..c89534a60c 100644 --- a/modules/vorbis/audio_stream_ogg_vorbis.cpp +++ b/modules/vorbis/audio_stream_ogg_vorbis.cpp @@ -390,6 +390,9 @@ Ref<AudioSamplePlayback> AudioStreamPlaybackOggVorbis::get_sample_playback() con void AudioStreamPlaybackOggVorbis::set_sample_playback(const Ref<AudioSamplePlayback> &p_playback) { sample_playback = p_playback; + if (sample_playback.is_valid()) { + sample_playback->stream_playback = Ref<AudioStreamPlayback>(this); + } } AudioStreamPlaybackOggVorbis::~AudioStreamPlaybackOggVorbis() { |
