Skip to content

Commit aad7830

Browse files
committed
[raudio]: free converterResidual in UnloadSoundAlias to prevent leak
The example audio_sound_multi was leaking memory every single time the spacebar was pressed. ```c Direct leak of 576 byte(s) in 9 object(s) allocated from: #0 0x758a41019447 in calloc (/usr/lib/liblsan.so.0+0x19447) (BuildId: 8ee115309adc591d231c961c43d245cfa68d9aa7) #1 0x562dfbd2c4f3 in LoadAudioBuffer (/home/peter/raylib/examples/audio/audio_sound_multi+0xfa4f3) (BuildId: ea2a6f45d724abeccf904143a32012266f259f93) ``` This patch fixes that leak.
1 parent 07b729d commit aad7830

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

src/raudio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,6 +1048,7 @@ void UnloadSoundAlias(Sound alias)
10481048
{
10491049
UntrackAudioBuffer(alias.stream.buffer);
10501050
ma_data_converter_uninit(&alias.stream.buffer->converter, NULL);
1051+
RL_FREE(alias.stream.buffer->converterResidual);
10511052
RL_FREE(alias.stream.buffer);
10521053
}
10531054
}

0 commit comments

Comments
 (0)