fix for bug that software crashed in case the driver properties of current selected driver have incompatibly changed

This commit is contained in:
Volker Fischer 2009-11-30 21:16:40 +00:00
parent 05e21fa2bc
commit 278a252822
2 changed files with 19 additions and 4 deletions

View file

@ -380,7 +380,7 @@ void CClientSettingsDlg::OnSoundCrdSelection ( int iSndDevIdx )
if ( !strError.isEmpty() )
{
QMessageBox::critical ( 0, APP_NAME,
QMessageBox::critical ( this, APP_NAME,
QString ( "The selected audio device could not be used because "
"of the following error: " ) + strError +
QString ( " The previous driver will be selected." ), "Ok", 0 );

View file

@ -76,9 +76,24 @@ std::string CSound::SetDev ( const int iNewDev )
if ( !strErrorMessage.empty() )
{
// loading and initializing the new driver failed, go back to
// original driver and display error message
LoadAndInitializeDriver ( lCurDev );
if ( iNewDev != lCurDev )
{
// loading and initializing the new driver failed, go back to
// original driver and display error message
LoadAndInitializeDriver ( lCurDev );
}
else
{
// the same driver is used but the driver properties seems to
// have changed so that they are not compatible to our
// software anymore
QMessageBox::critical (
0, APP_NAME, "The audio driver properties have changed to "
"a state which is incompatible to this software. "
"Please restart the software.", "Close", 0 );
_exit ( 0 );
}
// store error return message
strReturn = strErrorMessage;