void openALexit(){ if(alutExit()!=AL_TRUE){ error.writeToLog("alutExit error"); }}...// InitializationalutInit(0,0);alGetError();atexit(openALexit);
Before the program has exited I unbind all my buffers (using AL_NONE) and free them using alDeleteBuffers. This is wrapped in the function deleteAllSoundBuffers(). I then delete the sources:
OpenALObject::~OpenALObject(){ deleteAllSoundBuffers(); // Deletes all openal buffers for(int i=0;i<MAX_CHANNELS;i++){ alDeleteSources(1,&mGSoundSource.mSource); if(alGetError()!=AL_NO_ERROR){ error.writeToLog("alDeleteSources error."); } }}
The program deletes all my buffers and sources before the atexit function is called. I have also tried running the program without the atexit function and directly call alutexit() when the program reaches the end, same problem. I have absolutely no clue why the stuttering can be heard. There should be no sources or buffers present.
Any help appreciated.