Hi, I’m working on a crash bug that happens sometimes when traveling between levels. It’s during cleanup code for a basic channel listener we use to display a waveform. Cleanup looks like this:
if (bIsRegistered)
{
// clear userdata so we don't try to do something with a deleted channel listener in our callback.
verifyfmod(CaptureDSP->setUserData(nullptr));
// might fail if FMOD has already marked it for cleanup,
// in which case trying to release it can cause a crash.
if (FMOD_OK == Channel->removeDSP(CaptureDSP))
{
CaptureDSP->release();
}
CaptureDSP = nullptr;
bIsRegistered = false;
}
Where CaptureDSP is an FMOD::DSP* and Channel is an FMOD::ChannelGroup*.
The crash occurs when calling removeDSP, two levels deep in fmodL.dll:
> fmodL.dll!00007fffde036a3c() Unknown
fmodL.dll!00007fffddf5d1e2() Unknown
As you can see from the comment above, I’ve already encountered a crash here when calling release on the dsp pointer. It seems like removeDSP should always be safe to call, even if the channel has shutdown and already cleaned up dsp. So I’m wondering what might the cause of the crash here.
We are currently running FMOD version 2.03.08.