The docs for this structure mention that it needs to have the same lifetime as the fmod system as references are kept and the struct accessed during operations. I wondered if this is still true and if so, if the lifetime is actually narrower than that. Say, only kept for the lifetime of the DSP object.
- mcb asked 4 years ago
Thanks for pointing that out, the docs aren’t exactly correct here.
The FMOD_DSP_DESCRIPTION struct isn’t referenced, all the members are copied.
The only issue is the paramdesc member, that pointer is copied so the memory it points to must remain valid for the life of the DSP.
[quote="mathew":29rsrkrk]I haven’t been able to find reference to that in the documentation, whereabouts did you see it?
In the .chm docs in the FmodEx install under API reference > FMOD Ex API references > Structures > FMOD_DSP_DESCRIPTION:
Some members of this structure are referenced directly inside FMOD so the structure should be allocated statically or at least remain in memory for the lifetime of the system.
- mcb answered 4 years ago
I haven’t been able to find reference to that in the documentation, whereabouts did you see it?
Functions such as System::createDSP and System::registerDSP that take FMOD_DSP_DESCRIPTION pointers copy the values internally so you shouldn’t have to hold onto it.
Please login first to submit.