diff options
author | Chris Robinson <[email protected]> | 2011-08-25 11:33:13 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-25 11:33:13 -0700 |
commit | ccc2644e6b8a8af3ee923f4427a326df46f719ea (patch) | |
tree | a92af78ce1dc5643ac5e6a2c6b49a245378b50b1 | |
parent | 7e2155d937e66dc7c4a1445bf12e64684eebb5a0 (diff) |
Free the WaveIn buffers' data after unpreparing them all
-rw-r--r-- | Alc/backends/winmm.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Alc/backends/winmm.c b/Alc/backends/winmm.c index 2a286259..0a186662 100644 --- a/Alc/backends/winmm.c +++ b/Alc/backends/winmm.c @@ -486,10 +486,10 @@ static void WinMMStopPlayback(ALCdevice *device) static ALCenum WinMMOpenCapture(ALCdevice *pDevice, const ALCchar *deviceName) { WAVEFORMATEX wfexCaptureFormat; + ALbyte *BufferData = NULL; DWORD ulCapturedDataSize; WinMMData *pData = NULL; UINT lDeviceID = 0; - ALbyte *BufferData; ALint lBufferSize; MMRESULT res; ALuint i; @@ -605,14 +605,11 @@ failure: if(pData->hWaveThread) CloseHandle(pData->hWaveThread); - for(i = 0;i < 4;i++) + if(BufferData) { - if(pData->WaveBuffer[i].lpData) - { + for(i = 0;i < 4;i++) waveInUnprepareHeader(pData->hWaveHandle.In, &pData->WaveBuffer[i], sizeof(WAVEHDR)); - if(i == 0) - free(pData->WaveBuffer[i].lpData); - } + free(BufferData); } if(pData->pRing) |