Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.7.2
-
win7, app is set "global flags " in windows debug tools
-
d3c02f0c51f9cf69245a42ee690d90cd657c5fe2
Description
I use windows debug tools (global flags ) to check memory errory of my Qt application .
I found that ,when call QudioInput::stop(), my app crash ,after debugging and analysising I may found probrem ,as follows:
in qaudioinput_win32_p.cpp
void QAudioInputPrivate::close()
{
if(deviceState == QAudio::StoppedState)
return;
deviceState = QAudio::StoppedState;
waveInReset(hWaveIn);
waveInClose(hWaveIn);//
int count = 0;
while(!finished && count < 500)
mutex.lock();
for(int i=0; i<waveFreeBlockCount; i++)
waveInUnprepareHeader(hWaveIn,&waveBlocks[i],sizeof(WAVEHDR));
freeBlocks(waveBlocks);//
mutex.unlock();
}
I thought the probrem is that:
1 waveInClose is called first, and then hWaveIn become invalid.
2 waveInUnprepareHeader is called in freeBlocks() which pass it an invalid param of hWaveIn.
3 so my app crash .