aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alMidi.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenAL32/alMidi.c')
-rw-r--r--OpenAL32/alMidi.c21
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);
+ }
+}