mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 15:42:54 +00:00
Fix memory leak causing soundfonts not to be deleted in delete_fluid_synth
This commit is contained in:
parent
5b3ba5d678
commit
57b0b7835c
1 changed files with 7 additions and 2 deletions
|
@ -792,8 +792,13 @@ delete_fluid_synth(fluid_synth_t* synth)
|
|||
/* turn off all voices, needed to unload SoundFont data */
|
||||
if (synth->voice != NULL) {
|
||||
for (i = 0; i < synth->nvoice; i++) {
|
||||
if (synth->voice[i] && fluid_voice_is_playing (synth->voice[i]))
|
||||
fluid_voice_off (synth->voice[i]);
|
||||
fluid_voice_t* voice = synth->voice[i];
|
||||
if (!voice)
|
||||
continue;
|
||||
fluid_voice_unlock_rvoice(voice);
|
||||
fluid_voice_overflow_rvoice_finished(voice);
|
||||
if (fluid_voice_is_playing(voice))
|
||||
fluid_voice_off(voice);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue