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 /Alc | |
parent | 73fc4592ab8fd3c3bbff608ccfbd8def756def06 (diff) |
Properly initialize and cleanup the soundfont map
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -35,6 +35,7 @@ #include "alBuffer.h" #include "alAuxEffectSlot.h" #include "alError.h" +#include "alMidi.h" #include "bs2b.h" #include "alu.h" @@ -1948,6 +1949,13 @@ static ALCvoid FreeDevice(ALCdevice *device) } ResetUIntMap(&device->FilterMap); + if(device->SfontMap.size > 0) + { + WARN("(%p) Deleting %d Soundfont(s)\n", device, device->SfontMap.size); + ReleaseALSoundfonts(device); + } + ResetUIntMap(&device->SfontMap); + free(device->Bs2b); device->Bs2b = NULL; @@ -2884,6 +2892,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *deviceName) InitUIntMap(&device->BufferMap, ~0); InitUIntMap(&device->EffectMap, ~0); InitUIntMap(&device->FilterMap, ~0); + InitUIntMap(&device->SfontMap, ~0); //Set output format device->FmtChans = DevFmtChannelsDefault; @@ -3168,6 +3177,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *deviceName, InitUIntMap(&device->BufferMap, ~0); InitUIntMap(&device->EffectMap, ~0); InitUIntMap(&device->FilterMap, ~0); + InitUIntMap(&device->SfontMap, ~0); device->DeviceName = NULL; @@ -3345,6 +3355,7 @@ ALC_API ALCdevice* ALC_APIENTRY alcLoopbackOpenDeviceSOFT(const ALCchar *deviceN InitUIntMap(&device->BufferMap, ~0); InitUIntMap(&device->EffectMap, ~0); InitUIntMap(&device->FilterMap, ~0); + InitUIntMap(&device->SfontMap, ~0); factory = ALCloopbackFactory_getFactory(); device->Backend = V(factory,createBackend)(device, ALCbackend_Loopback); |