Been awhile since I last posted, working on a new application and come upon the stranged behavior, I am using a previous version of fmod 3.6, so it may have been fixed.

The jest of it is, that the audio lib works just fine as usual, however when the application is shutting down it destorys several classes, which triggers thier deconstructors, in one of which I stop playing any tunes the user might be doing free samples ect…Oddly when closing fmod its throwing exceptions of illegal handles if i do this….not within the deconstructors it works just perfectly….boggle.

Here is a snip of the shutdown code.

if( m_lpMusicStream != NULL )
FSOUND_Stream_SetEndCallback( m_lpMusicStream, NULL, 0 );
FSOUND_Stream_Stop( m_lpMusicStream );
FSOUND_Stream_Close( m_lpMusicStream );

    m_lpMusicStream = NULL;



Theres nothing abnormal about that, that i can see, I often set callbacks to NULL before, so I can’t see it being that. I have tried putting a sleep before FSOUND_Close(), a am at a total loss, any ideas?


  • You must to post comments

does it work if you dont set the callbacks on shutdown?

  • You must to post comments

[quote="birty":1afzckly]does it work if you dont set the callbacks on shutdown?[/quote:1afzckly]

erm, sure it does, but the callback is used to trigger the system into selecting another tune to play, heh iam just too lazy to handle it differently so rather then that i set the stream to null, close and kill it then shutdown the lib.

and if your asking does it work if i don’t set it to null, it still crashes, yes it does, it crashes on the stream_close, throws a invalid handle.


  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.