Rémi Bernon (@rbernon) commented about dlls/dmsynth/synth.c:
free(voice); }
LIST_FOR_EACH_ENTRY_SAFE(preset, next, &This->presets, struct preset, entry)
{
list_remove(&preset->entry);
instrument_release(preset->instrument);
delete_fluid_preset(preset->fluid_preset);
free(preset);
}
I think this should also be done on Close, to avoid keeping instruments and waves alive when the synth is destroyed / re-created.
Ideally we should not even keep presets alive more than necessary, but I'm not sure how to do that if FluidSynth doesn't give any info on referenced / released presets (maybe we could try to upstream a better mechanism there).