0
0

If an EventInstance has a callback that uses EventInstance::release(), fmod will crash on a call to EventInstance::stop(FMOD_STUDIO_STOP_IMMEDIATE).

Here is a simple callback from the examples that just calls EventInstance::release():

[code:4dst3y57]
FMOD_RESULT F_CALLBACK eventCallback(FMOD_STUDIO_EVENT_CALLBACK_TYPE type, void* parameters)
{
if (type == FMOD_STUDIO_EVENT_CALLBACK_STOPPED)
{
ERRCHECK( ((FMOD::Studio::EventInstance*)parameters)->release() );
}

return FMOD_OK;

}
[/code:4dst3y57]

Assuming I have an already created eventInstance, the following code will crash fmod:

[code:4dst3y57]
ERRCHECK( eventInstance.setCallback(&eventCallback) );
ERRCHECK( eventInstance.stop(FMOD_STUDIO_STOP_IMMEDIATE) );
[/code:4dst3y57]

I am guessing this is because FMOD_STUDIO_STOP_IMMEDIATE releases the event instance internally. Can anybody confirm this? Currently I am working around this by setting the callback to null before I use FMOD_STUDIO_STOP_IMMEDIATE.

  • You must to post comments
0
0

Thanks for the report. We have reproduced the crash here and will get this fixed as soon as possible.

  • You must to post comments
0
0

This crash has now been fixed for the next release (version 0.01.04).

  • You must to post comments
0
0

Awesome, thanks!

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.