Recently I’ve ran into an error that has me completely stumped. Whenever I try to debug I’m met with the error "Exception thrown: read access violation. _Mem was nullptr.
I went to the place where the call stack showed the exception happening which is right here. I’ve checked but no matter what I seem to do, nothing will fix it.
Not sure why the Compiler didn’t pick that up, and the Error made no sense to me, I found it by just back tracking and commenting out line by line till it didn’t crash anymore!
Don’t copy&paste strings (actually don’t copy&paste at all, but that is a different story).
Instead define the paramIDs as constexpr or static strings:
The compiler doesn’t read string literals at all. Those will only be found at runtime.
Second advice:
Don’t use the getRawParameterValue() in the processing, as it is a slow method.
Instead keep a pointer to the properly casted version. Of course you need to change the ChainSettings a bit, because at the moment that is copied and destroyed a lot.
If the getChainSettings() method was a method of the processor, you could store the pointers in the processor.