mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 18:19:22 +00:00
Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>
Fixed memory leak in waveOutOpen/waveOutClose.
This commit is contained in:
parent
610b001de5
commit
d604b4bd5b
|
@ -3288,6 +3288,12 @@ UINT16 WINAPI waveOutOpen16(HWAVEOUT16* lphWaveOut, UINT16 uDeviceID,
|
|||
if (dwFlags & WAVE_FORMAT_QUERY) {
|
||||
TRACE(mmsys, "End of WAVE_FORMAT_QUERY !\n");
|
||||
dwRet = waveOutClose(hWaveOut);
|
||||
if (lphWaveOut) *lphWaveOut = 0;
|
||||
}
|
||||
else if (dwRet != MMSYSERR_NOERROR)
|
||||
{
|
||||
USER_HEAP_FREE(hWaveOut);
|
||||
if (lphWaveOut) *lphWaveOut = 0;
|
||||
}
|
||||
return dwRet;
|
||||
}
|
||||
|
@ -3306,12 +3312,15 @@ UINT WINAPI waveOutClose(HWAVEOUT hWaveOut)
|
|||
UINT16 WINAPI waveOutClose16(HWAVEOUT16 hWaveOut)
|
||||
{
|
||||
LPWAVEOPENDESC lpDesc;
|
||||
DWORD dwRet = 0;
|
||||
|
||||
TRACE(mmsys, "(%04X)\n", hWaveOut);
|
||||
|
||||
lpDesc = (LPWAVEOPENDESC) USER_HEAP_LIN_ADDR(hWaveOut);
|
||||
if (lpDesc == NULL) return MMSYSERR_INVALHANDLE;
|
||||
return wodMessage(lpDesc->uDeviceID, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
||||
dwRet = wodMessage(lpDesc->uDeviceID, WODM_CLOSE, lpDesc->dwInstance, 0L, 0L);
|
||||
USER_HEAP_FREE(hWaveOut);
|
||||
return dwRet;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
|
|
Loading…
Reference in a new issue