diff options
author | Chris Robinson <[email protected]> | 2013-12-18 23:21:59 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-18 23:21:59 -0800 |
commit | 1e536cf7ca6413cc20536df144bb4eba8797bbad (patch) | |
tree | de263227d73e852d4c0273c3bd87664a2a3f22d2 /OpenAL32/alMidi.c | |
parent | 73fc4592ab8fd3c3bbff608ccfbd8def756def06 (diff) |
Properly initialize and cleanup the soundfont map
Diffstat (limited to 'OpenAL32/alMidi.c')
-rw-r--r-- | OpenAL32/alMidi.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/OpenAL32/alMidi.c b/OpenAL32/alMidi.c index b311d390..c67ef81d 100644 --- a/OpenAL32/alMidi.c +++ b/OpenAL32/alMidi.c @@ -316,3 +316,24 @@ AL_API void AL_APIENTRY alMidiGainSOFT(ALfloat value) done: ALCcontext_DecRef(context); } + + +/* ReleaseALSoundfonts + * + * Called to destroy any soundfonts that still exist on the device + */ +void ReleaseALSoundfonts(ALCdevice *device) +{ + ALsizei i; + for(i = 0;i < device->SfontMap.size;i++) + { + ALsoundfont *temp = device->SfontMap.array[i].value; + device->SfontMap.array[i].value = NULL; + + FreeThunkEntry(temp->id); + ALsoundfont_Destruct(temp); + + memset(temp, 0, sizeof(*temp)); + free(temp); + } +} |