damocles
08-12-2003, 04:02 PM
I've just started learning openAL following the tuts here on devMaster. I am at the end of the first tut and all is great except for when exiting the program. It always throws an unhandled exception error. The exit code is pretty strightforward:
* *for (int i=0; i<64; i++)
{
*if (buffers[i]!=999)
*{
* alDeleteBuffers(1, &buffers[i]);
* alDeleteSources(1, &sources[i]);
*}
}
* *alutExit();
buffers[] and source[] are arrays of unsigned ints that stored the buffer and source "names". They are all set to 999 before starting so I know which buffers are in use and which to delete on exit. That's all there is to it. Somehow this throws an unhandled exception error. The sound loads and plays just fine.
Any ideas anyone?
EDIT:
Nevermind, turned out to be a memory initialising problem :rolleyes:
* *for (int i=0; i<64; i++)
{
*if (buffers[i]!=999)
*{
* alDeleteBuffers(1, &buffers[i]);
* alDeleteSources(1, &sources[i]);
*}
}
* *alutExit();
buffers[] and source[] are arrays of unsigned ints that stored the buffer and source "names". They are all set to 999 before starting so I know which buffers are in use and which to delete on exit. That's all there is to it. Somehow this throws an unhandled exception error. The sound loads and plays just fine.
Any ideas anyone?
EDIT:
Nevermind, turned out to be a memory initialising problem :rolleyes: