@Salas00
I back to the issues again (with a crash on exit), and that what I got so far:
If I compile code with the latest openal/freealut, then on exit I have 3 crashes at the same time: 2 crashes at in aluxMixData() and after that crash in __NewlibCall() and one crash in alc_cleanup(). None of which called directly from the game.
If i fully comment out all the code inside of that function:
OpenALAudioSystem::~OpenALAudioSystem() {
// Free sound instances before deleting sound manager, else
// querying if sounds are streams when deleting instances will fail
FreeSoundInstances();
SafeDelete(m_SoundManager);
alcMakeContextCurrent(nullptr);
if (context) alcDestroyContext(context);
if (device) alcCloseDevice(device);
alutExit();
}
Then nothing changes at all. Like all the code called not from the game itself.
Then I tried an older version of openal (some 7-8 years old openal) with also fully commented out that block. And this time i have only one crash, which is come from ReleaseALC->alcDestroyContext->__NewlibCall. All of these calls are also not from the game itself.
The only way how I can get rid of this crash is to use an older version of SDL2 (yeah, strange) + that old version of openal. How SDL2 can have an impact here I don't know because openal/alut didn't use anything from SDL2, but maybe it just causes memory shifts, and so bug somehow autohides.
But then why on exit, when we remove the full part about freeing audio resources from the game's code?