Releasing EventInstance in Visual Studio crashes

I’m using visual studio in order to build the following code (which is the same on Mac and iOS). It works perfectly on the latter systems but not on Windows. It crashes on the following line: (I’ve got the .pdb files from the nice people of steam)

fmodstudioL.dll!FMOD::AsyncManager::isInAnyAsyncThread() Line 132 C++

I saw that someone else had the same issue on iOS; this was caused by a linking error (link: http://52.88.2.202/questions/question/releasing-events-event). So this could sure alse be my problem… But I just can’t get my head around it…

// Get the id for the event
FMOD::Studio::ID eventID = { 0 };
ERRCHECK(_system->lookupID("event:/Traps/rocketheat/shoot", &eventID));

// Get the description
FMOD::Studio::EventDescription *eventDescription;
ERRCHECK(_system->getEvent(&eventID, FMOD_STUDIO_LOAD_BEGIN_NOW, &eventDescription));

// Create an instance of the event
FMOD::Studio::EventInstance *eventInstance = NULL;
ERRCHECK(eventDescription->createInstance(&eventInstance));

// Play the instance
ERRCHECK(eventInstance->start());

// release the event 
ERRCHECK(eventInstance->release());

There isn’t anything in that code snippet out of the ordinary, it should work fine.

Could you contact support@fmod.org with some more details about your FMOD version, and your initialization settings (such as are you overriding memory or file callbacks, etc). We can take it from there.

2 Likes

Well,

First of all; thanks Geoff for your reaction!

After some seriously heavy debugging; trying out all kind of different setups… I found the problem:

FMOD::Studio::System::create(&_system);
ERRCHECK( FMOD::Studio::System::create(&_system) );

As you can see I called the create function twice. After removing the first line everything works fine.

1 Like

Thanks for your update. Having a second system isn’t what you want, but it shouldn’t crash. That has been fixed and will be rolled out in the next patch release.