diff options
author | Chris Robinson <[email protected]> | 2013-12-20 01:04:38 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-12-20 01:04:38 -0800 |
commit | ede3c208806af5c1180b72cae0ba4943bd6f0bfd (patch) | |
tree | 42cf2d4f0a862e64a1216c313913ef3e27efbb1c | |
parent | 5dc3f3626d63361f4cefc829bce9aedb3c5774cf (diff) |
Free thunk entry in the object destructor
-rw-r--r-- | Alc/midi/base.c | 4 | ||||
-rw-r--r-- | OpenAL32/alInstrument.c | 3 | ||||
-rw-r--r-- | OpenAL32/alPreset.c | 3 | ||||
-rw-r--r-- | OpenAL32/alSoundfont.c | 3 |
4 files changed, 4 insertions, 9 deletions
diff --git a/Alc/midi/base.c b/Alc/midi/base.c index a5c50504..45136faf 100644 --- a/Alc/midi/base.c +++ b/Alc/midi/base.c @@ -11,6 +11,7 @@ #include "alMidi.h" #include "alMain.h" #include "alError.h" +#include "alThunk.h" #include "evtqueue.h" #include "rwlock.h" #include "alu.h" @@ -377,6 +378,7 @@ void ALsfinstrument_Destruct(ALsfinstrument *self) { ALsizei i; + FreeThunkEntry(self->id); self->id = 0; for(i = 0;i < self->NumZones;i++) @@ -405,6 +407,7 @@ void ALsfpreset_Destruct(ALsfpreset *self) { ALsizei i; + FreeThunkEntry(self->id); self->id = 0; for(i = 0;i < self->NumZones;i++) @@ -439,6 +442,7 @@ void ALsoundfont_Destruct(ALsoundfont *self) { ALsizei i; + FreeThunkEntry(self->id); self->id = 0; for(i = 0;i < self->NumPresets;i++) diff --git a/OpenAL32/alInstrument.c b/OpenAL32/alInstrument.c index 69f6868f..dfcb93ba 100644 --- a/OpenAL32/alInstrument.c +++ b/OpenAL32/alInstrument.c @@ -45,7 +45,6 @@ AL_API void AL_APIENTRY alGenInstrumentsSOFT(ALsizei n, ALuint *ids) err = InsertUIntMapEntry(&device->InstrumentMap, inst->id, inst); if(err != AL_NO_ERROR) { - FreeThunkEntry(inst->id); ALsfinstrument_Destruct(inst); memset(inst, 0, sizeof(*inst)); free(inst); @@ -91,7 +90,6 @@ AL_API ALvoid AL_APIENTRY alDeleteInstrumentsSOFT(ALsizei n, const ALuint *ids) { if((inst=RemoveInstrument(device, ids[i])) == NULL) continue; - FreeThunkEntry(inst->id); ALsfinstrument_Destruct(inst); @@ -132,7 +130,6 @@ void ReleaseALInstruments(ALCdevice *device) ALsfinstrument *temp = device->InstrumentMap.array[i].value; device->InstrumentMap.array[i].value = NULL; - FreeThunkEntry(temp->id); ALsfinstrument_Destruct(temp); memset(temp, 0, sizeof(*temp)); diff --git a/OpenAL32/alPreset.c b/OpenAL32/alPreset.c index 60f25a7b..873d9ad1 100644 --- a/OpenAL32/alPreset.c +++ b/OpenAL32/alPreset.c @@ -45,7 +45,6 @@ AL_API void AL_APIENTRY alGenPresetsSOFT(ALsizei n, ALuint *ids) err = InsertUIntMapEntry(&device->PresetMap, preset->id, preset); if(err != AL_NO_ERROR) { - FreeThunkEntry(preset->id); ALsfpreset_Destruct(preset); memset(preset, 0, sizeof(*preset)); free(preset); @@ -91,7 +90,6 @@ AL_API ALvoid AL_APIENTRY alDeletePresetsSOFT(ALsizei n, const ALuint *ids) { if((preset=RemovePreset(device, ids[i])) == NULL) continue; - FreeThunkEntry(preset->id); ALsfpreset_Destruct(preset); @@ -132,7 +130,6 @@ void ReleaseALPresets(ALCdevice *device) ALsfpreset *temp = device->PresetMap.array[i].value; device->PresetMap.array[i].value = NULL; - FreeThunkEntry(temp->id); ALsfpreset_Destruct(temp); memset(temp, 0, sizeof(*temp)); diff --git a/OpenAL32/alSoundfont.c b/OpenAL32/alSoundfont.c index 33b3ce3e..12f89094 100644 --- a/OpenAL32/alSoundfont.c +++ b/OpenAL32/alSoundfont.c @@ -45,7 +45,6 @@ AL_API void AL_APIENTRY alGenSoundfontsSOFT(ALsizei n, ALuint *ids) err = InsertUIntMapEntry(&device->SfontMap, sfont->id, sfont); if(err != AL_NO_ERROR) { - FreeThunkEntry(sfont->id); ALsoundfont_Destruct(sfont); memset(sfont, 0, sizeof(ALsoundfont)); free(sfont); @@ -91,7 +90,6 @@ AL_API ALvoid AL_APIENTRY alDeleteSoundfontsSOFT(ALsizei n, const ALuint *ids) { if((sfont=RemoveSfont(device, ids[i])) == NULL) continue; - FreeThunkEntry(sfont->id); ALsoundfont_Destruct(sfont); @@ -222,7 +220,6 @@ void ReleaseALSoundfonts(ALCdevice *device) ALsoundfont *temp = device->SfontMap.array[i].value; device->SfontMap.array[i].value = NULL; - FreeThunkEntry(temp->id); ALsoundfont_Destruct(temp); memset(temp, 0, sizeof(*temp)); |