SL-19585 Fix openal exit failure logging

master
Andrey Kleshchev 2024-04-05 22:26:06 +03:00 committed by Andrey Kleshchev
parent d9d180aa00
commit 7dbdfda7d6
1 changed files with 10 additions and 1 deletions

View File

@ -135,10 +135,19 @@ void LLAudioEngine_OpenAL::shutdown()
LL_INFOS() << "About to LLAudioEngine::shutdown()" << LL_ENDL;
LLAudioEngine::shutdown();
// If a subsequent error occurs while there is still an error recorded
// internally, the second error will simply be ignored.
// Clear previous error to make sure we will captuare a valid failure reason
ALenum error = alutGetError();
if (error != ALUT_ERROR_NO_ERROR)
{
LL_WARNS() << "Uncleared error state prior to shutdown: "
<< alutGetErrorString(error) << LL_ENDL;
}
LL_INFOS() << "About to alutExit()" << LL_ENDL;
if(!alutExit())
{
LL_WARNS() << "Nuts." << LL_ENDL;
LL_WARNS() << "LLAudioEngine_OpenAL::shutdown() ALUT shutdown failed: " << alutGetErrorString (alutGetError ()) << LL_ENDL;
}